2
votes

I'm using the bootstrap datetimepicker from Eonasdan: http://eonasdan.github.io/bootstrap-datetimepicker/. I found an issue similar to other questions (bootstrap-datetimepicker hours and minutes not defaulted to 00:00): when i open the datetimepicker, the time should be set as default to 00:00.

I tried setting a default date:

var options = {
    format: 'DD/MM/YYYY HH:mm:ss',
    defaultDate: moment('2015-01-01')
};

$('#datetimepicker1').datetimepicker(options);

http://jsfiddle.net/nrh62dhk/

And it works, unless i clear the textbox (delete all text), then it shows again the current time instead of 00:00.

Has anyone found a solution? Thanks.

1

1 Answers

3
votes

Using the "useCurrent: 'day'" option did the trick:

var options = {
    format: 'DD/MM/YYYY HH:mm:ss',
    defaultDate: moment('2015-01-01'),
    useCurrent:'day'
};

$('#datetimepicker1').datetimepicker(options);

http://jsfiddle.net/nrh62dhk/1/