简体   繁体   English

initialDate在bootstrap-datetimepicker中不起作用?

[英]initialDate not working in bootstrap-datetimepicker?

My today Date is 16-1-2014 and I set default date is 17-01-2014 but this is not working 我今天的日期是16-1-2014 ,我设置默认日期是17-01-2014但这不起作用

$('#datetimepicker').datetimepicker({
   startDate: new Date(),
   autoclose: true,
   todayBtn: true,
   todayHighlight: false,
   initialDate: new Date(2014, 00, 17),

   //update: new Date(2014, 00, 17),
   // onRender: function(ev) {
   //   console.log(ev.date.valueOf());
   // },

   format: 'dd/MM/yyyy hh:mm:ss',
   language: 'en'
})

源代码

output show on calendar 输出显示在日历上

I am using below library bootstrap-datetimepicker 我正在使用下面的库bootstrap-datetimepicker

Looking at the code it looks like the initialDate is not considered at all if your input element has a value attribute. 查看代码 ,如果您的input元素具有value属性,则看起来根本不考虑initialDate

So if you want initiaDate to be used, make sure your input doesn't have a value (ie value="" or no value at all). 因此,如果您希望使用initiaDate ,请确保您的输入没有值(即value=""或根本没有值)。

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

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