Topic: Set Datetimepicker dynamically
ppt premium asked 1 year ago
let date = new Date('2022-07-10T13:24:00'); document.getElementById('myDateTime').value = date;
When I click to change the value, then the currently selected date/time should match this value.
Although this displays something in the input box, when I click to change the value there is no currently selected date or time in the popup dialog.
Resources (screenshots, code snippets etc.)
I have also tried setting the value using the locale-specific string format used, to no avail. Any help greatly received!
You need to dispose datetimepicker and then reinitialize it with new date and new time. Here is the snippet https://mdbootstrap.com/snippets/standard/d-wajszczuk/3682055#js-tab-view.
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Premium
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 3.10.2
- Device: Desktop
- Browser: Edge
- OS: Win10
- Provided sample code: No
- Provided link: No