Search code examples
javascriptjquerytempus-dominus-datetimepicker

Disable just the past date of the calendar and not the time of tempusdominus


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.


Solution

  • 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