Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

ERROR TypeError: date.getTime is not a function #165

Open
ryndm opened this issue Nov 4, 2020 · 1 comment
Open

ERROR TypeError: date.getTime is not a function #165

ryndm opened this issue Nov 4, 2020 · 1 comment

Comments

@ryndm
Copy link

ryndm commented Nov 4, 2020

I get the following error on random occasions

ERROR TypeError: date.getTime is not a function at NativeDateAdapter.push../node_modules/saturn-datepicker/fesm5/saturn-datepicker.js.NativeDateAdapter.isValid (saturn-datepicker.js:693) at NativeDateAdapter.push../node_modules/saturn-datepicker/fesm5/saturn-datepicker.js.DateAdapter.sameDate (saturn-datepicker.js:182) at SatDatepickerInput.set [as value] (saturn-datepicker.js:4388) at SafeSubscriber._next (saturn-datepicker.js:4329) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:196) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:134) at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77) at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54) at Subject.push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (Subject.js:47) at SatDatepicker.push../node_modules/saturn-datepicker/fesm5/saturn-datepicker.js.SatDatepicker._selectRange (saturn-datepicker.js:3764)

Any fix to this?

@aminesafi8
Copy link

I think that the returned date is a moment object, try this
date.toDate().getTime()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants