Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

$('#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'
})

Source Code

output show on calendar

I am using below library bootstrap-datetimepicker

like image 711
Vijay Kumbhani Avatar asked Nov 10 '22 14:11

Vijay Kumbhani


1 Answers

Looking at the code it looks like the initialDate is not considered at all if your input element has a value attribute.

So if you want initiaDate to be used, make sure your input doesn't have a value (i.e. value="" or no value at all).

like image 182
alexcasalboni Avatar answered Nov 14 '22 23:11

alexcasalboni