简体   繁体   English

jQuery datepicker最小最大不起作用

[英]jquery datepicker min max not working

Jquery UI datepicker breaking when adding min max dates. 添加最小最大日期时,jQuery UI datepicker中断。 Heres my code, works fine with the dateformat and allowTimes, but brings up a blank calender when adding min / max dates. 这是我的代码,可以很好地与dateformat和allowTimes配合使用,但是在添加最小/最大日期时会显示空白的日历。

$('#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: 假设您正在使用此datetimepicker ,请尝试将最小和最大日期指定为字符串:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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