In chrome browser Bootstrap Datetimepicker work after I inspect the web page only. Normally it does't work

731 Views Asked by At

Once I inspect the web page working fine but I opened in Incognito it doesn't work.

jQuery('#pickupdate').datetimepicker({

    format: 'DD-MM-YYYY',
    ignoreReadonly: true,
     minDate: new Date().setHours(0,0,0,0)

});


jQuery('#dropoffdate').datetimepicker({

    format: 'DD-MM-YYYY',
    ignoreReadonly: true,
    minDate: new Date().setHours(0,0,0,0),
    useCurrent: false,

});
1

There are 1 best solutions below

0
On

Are you missing a Document Ready?

jQuery(function () {
    jQuery('#pickupdate').datetimepicker({
        format: 'DD-MM-YYYY',
        ignoreReadonly: true,
        minDate: new Date().setHours(0,0,0,0)
    });

    jQuery('#dropoffdate').datetimepicker({
        format: 'DD-MM-YYYY',
        ignoreReadonly: true,
        minDate: new Date().setHours(0,0,0,0),
        useCurrent: false
    });
});