-1

I'm using Bootstrap 3 datetimepicker, and from the author's examples, the author placed jQuery in the header and javascript right after the datetime inputs.

However, I read some posts suggesting that all scripts should be loaded last. But if I placed jQuery last, the datetimepickers will not work (since jQuery was not loaded, a

javascript uncaught referenceerror

will be reported).

I'm just wondering what is the best practice in using Bootstrap datetimepicker??

Community
  • 1
  • 1
hook38
  • 3,899
  • 4
  • 32
  • 52

1 Answers1

0
$('#dpStartDate').data({date: '2014-10-22'});
$('#dpStartDate').datepicker('update');
$('#dpStartDate').datepicker().children('input').val('2014-10-22');

set the calendar date on propertie data-date update (required) set the input value (remember the input is child of datepicker). this way you are setting the date to '2014-10-22'