jquery datepicker min max不工作

时间:2014-08-26 18:17:11

标签: javascript jquery datepicker

添加最小最大日期时,Jquery UI日期选择器中断。继承我的代码,使用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'
        ]
      });

1 个答案:

答案 0 :(得分:1)

假设您使用this datetimepicker,请尝试将最小和最大日期指定为字符串:

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