0
votes

Jquery UI datepicker breaking when adding min max dates. Heres my code, works fine with the dateformat and allowTimes, but brings up a blank calender when adding min / max dates.

$('#datetimepicker').datetimepicker({
        format:'d/m/Y H:i',
        minDate: new Date(2014, 10, 1),
        maxDate: new Date(2014, 11, 31),
        allowTimes:[
          '11:00','11:30','12:00','12:30','13:00','13:30','14:00',
          '18:00','18:30','19:00','19:30','20:00','20:30','21:00','21:30'
        ]
      });
1
Can you reproduce this with a jsFiddle.net example? - j08691
That's not the jQueryUI datepicker. What plugin are you using? - Jason P
Are you talking about the DateTimePicker Plugin? There's an example for min: xdsoft.net/jqplugins/datetimepicker/#minDate and max: xdsoft.net/jqplugins/datetimepicker/#maxTime. - John

1 Answers

1
votes

Assuming that you are using this datetimepicker, try specifying the min and max dates as string:

// assuming default value for
// formatDate which is Y/m/d
minDate: '2014/11/01'
maxDate: '2014/12/31'