Skip to content Skip to sidebar Skip to footer

Jquery Datetimepicker Input Text Showing Date 31/12/1899 When Time Selected

I am using the jquery datetimepicker and set it up as follows $('.fddatetimepicker').datetimepicker({ dateFormat: 'dd/mm/yy' }); No date is set by default. Whe

Solution 1:

just change the format of datetimepicker by using the below code. It will work like a charm. I had the same issue and I fixed using that approach below code.

$('.datetimepicker').datetimepicker({
                format: "dd-mm-yyyy hh:ii:00P",
                autoclose: true
            });

Solution 2:

You can use the "startDate: new Date" property to start on the current date.

Example:

$('.fddatetimepicker').datetimepicker({ 
             dateFormat: 'dd/mm/yy',
             startDate: newDate
        });

More options and properties in: http://xdsoft.net/jqplugins/datetimepicker/

Solution 3:

Try using format: 'mm/dd/yyyy hh:ii:ss P' The trick is to make sure your date format is the same as what the back-end returns.

Post a Comment for "Jquery Datetimepicker Input Text Showing Date 31/12/1899 When Time Selected"