【发布时间】:2020-06-11 16:38:15
【问题描述】:
我有一个 angular 8 的 sat-datepicker,带有 rangemode 道具动态,当 rangeMode 为 false 并更改为 true 时它可以工作,但反之亦然,如果我选择了一个范围日期,然后我想选择一个 sngle当 rangeMode 为 false 时,抛出此错误
ERROR TypeError: date.clone is not a function
at MomentDateAdapter.push../node_modules/@angular/material-moment-adapter/esm5/material-moment-adapter.es5.js.MomentDateAdapter.clone (material-moment-adapter.es5.js:212)
at MomentDateAdapter.push../node_modules/@angular/material-moment-adapter/esm5/material-moment-adapter.es5.js.MomentDateAdapter.isValid (material-moment-adapter.es5.js:395)
at MomentDateAdapter.push../node_modules/@angular/material/esm5/core.es5.js.DateAdapter.sameDate (core.es5.js:711)
at SatDatepickerInput.set [as value] (saturn-datepicker.js:4409)
at SafeSubscriber._next (saturn-datepicker.js:4329)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:192)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:130)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:76)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:53)
at Subject.push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (Subject.js:47)
【问题讨论】:
-
我也有同样的问题,如果我找到解决方法我会回答
标签: angular datepicker date-range