Topic: Problem setting start date in DatatimePicker

Francis Souza free asked 1 year ago


How do I start date and time from the current day (New Date()) using DataTimePicker

My code:

const d = new Date();
const h = d.getHours() + ':' + d.getMinutes();
const pickerTimeOptions = document.querySelector('#datetimepicker-dateOptions');
new mdb.Datetimepicker(pickerTimeOptions, {
    datepicker: { min: d},
    timepicker: { minTime: d },
});

I want the start time to be applied only on the current day... that way it applies to everyone, how do I block the past time of the current day only?

is there any other start date option that works in datatimepicker?


Mateusz Lazaru staff answered 1 year ago


Hi,

Currently there is no option to something like this, however I think it could be good feature, so I've added it to our todo list. Any workaround also isn't possible as long as timepicker has not update() method.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 4.2.0
  • Device: Computer
  • Browser: Chrome
  • OS: Window 10
  • Provided sample code: No
  • Provided link: No