KBom KBom - 7 months ago 34
Javascript Question

Datetimepicker maxDate not working

I am using jquery datetimepicker and trying to set the max date to be May 7th, for some reason, no matter what I put for the maxDate param, it always limits the maxDate to today (5-May-2016). Am I doing something wrong ?

Which then gives me the correct value, but the max date is always set to today and not 7-May-2016.

Code:

$(function(){
$('#AuditDate').datetimepicker({timepicker: false,format:'d-M-Y', maxDate: '07-May-2016', value: '05-May-2016'});
});

Answer

Try format below to match your maxDate format:

format:'dd-M-yy'