-
Using v6 from tempusdominus datepicker Reference: https://getdatepicker.com/6/functions.html I have tried many function function trying to set a value to the datetime picker but nothing is working,, below my tries:
The above sample was working in previous version (4) but in V6 it's giving error: Cannot read properties of undefined (reading 'date') 2nd try: Based on the SetVal Function mentioned in the documentation https://getdatepicker.com/6/functions.html
It's giving error: picker.setValue is not a function Would you please assist ? as the mentioned samples not clear in their official website... |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @Eonasdan i have been struggling into this since 2 days there is no clear documentation how to set a value !!! Please help tried this and not working as well:
dates.ts:248 Uncaught TypeError: Cannot read properties of undefined (reading 'clone') |
Beta Was this translation helpful? Give feedback.
-
Hey @basharald why don't you simply set the value to the input field and that's all?
|
Beta Was this translation helpful? Give feedback.
-
You need https://getdatepicker.com/6/functions.html#datesSet There's also |
Beta Was this translation helpful? Give feedback.
You need
picker.dates.setValue(new tempusDominus.DateTime())
https://getdatepicker.com/6/functions.html#datesSet
There's also
dates.setFromInput
anddates.parseInput
. parseInput returns a DateTime object.