-1

How do I just disable the past date of only the calendar and not the time picker in tempusdominus?

$(function () {
    $('#datetimepicker13').datetimepicker({
        inline: true,
        sideBySide: true,
        format: 'YYYY/MM/DD HH:mm',
        minDate: new Date()

    });
});

This code just disable both the past date and past time.

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Rei
  • 313
  • 2
  • 11
  • 2
    Perhaps `minDate: new Date(); minDate.setDate(minDate.getDate()-1); minDate.setHours(23,59,59,999)` since the dates seems to be on [day granularity](https://tempusdominus.github.io/bootstrap-4/Options/#endisableddates) – mplungjan Mar 19 '20 at 06:20
  • Not working. I tried to enabledHours: and list all the hours but still not working – Rei Mar 19 '20 at 06:45

1 Answers1

0

Solved. What worked for me is

    $(function () {
    $('#datetimepicker13').datetimepicker({
        showClose: true,
        inline: true,
        sideBySide: true,
        format: 'YYYY/MM/DD HH:mm',
        minDate: new Date().setHours(0,0,0,0),
    });
});

Thank you

Rei
  • 313
  • 2
  • 11