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:
var DateTimeVal = moment('05/07/2022 00:00').format('MM/DD/YYYY HH:mm');
$('#DateTime').data("DateTimePicker").date(DateTimeVal);
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
var DateTimeVal = moment('05/07/2022 00:00').format('MM/DD/YYYY HH:mm');
const picker = new tempusDominus.TempusDominus(document.getElementById('DateTime'));
picker.setValue(DateTimeVal);
It's giving error:
picker.setValue is not a function
Would you please assist ? as the mentioned samples not clear in their official website...