简体   繁体   中英

jquery datepicker min max not working

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'
        ]
      });

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM