Please note this question is about datetimepicker NOT datepicker.
I have a datetimepicker that is initialised to the current date. When user selects an option in a select element, I want to update the datetimepicker based on the selected date. Here is my code:
$("#date_from").datetimepicker({
format: 'D MMM Y - H:mm',
defaultDate: new Date(),
stepping: 10,
minDate: new Date()
});
$('select').on('change', function (e) {
updating_date = this.value; // gives a value like 2019-04-06 10:30:00
// I want to update the datetimepicker to reflect updating_date
}
Any help would be appreciated.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)