Hi,
I'm using the datetimepicker function for pick date and time,
$('#end').datetimepicker({
format: 'DD-MM-YYYY HH:mm',
collapse:false,
sideBySide:true,
useCurrent:false,
showClose:true
});
It is picking the date with the time 00:00 by default, Is there any way to set the default time value (e.g 23:00)?

Thanks
in the dev branch you might be able to set the viewDate, otherwise you can set the date. In either case you will have to set both date and time
$('#end').datetimepicker({
format: 'DD-MM-YYYY HH:mm',
collapse:false,
sideBySide:true,
useCurrent:false,
showClose:true,
viewDate:'23-04-2015 23:00'
});
it tried like this.but it is not working
@Fitzerbirth You already found a solution for it? viewDate also not working for me.
viewDate is in the dev branch
Yes :)
"eonasdan-bootstrap-datetimepicker": "https://github.com/Eonasdan/bootstrap-datetimepicker.git#development"
Otherwise I would get the error mesage that the option isn't recognized.
please post a fiddle of your issue
http://jsfiddle.net/f4nhwjaw/1/
I would expect that 2015-01-01 23:59:59 is preselected in the picker.
EDIT:
I just see it's AM/PM but the issue is the same.
@Fitzerbirth A workaround could be:
$('.datetime-picker').on('dp.change', function(e) {
if (e.oldDate === null) {
$(this).data('DateTimePicker').date(new Date(new Date().setHours(23, 59, 59)));
}
});
Proposed workaround above erases the first selected date.
Corrected workaround:
$('.datetime-picker').on('dp.change', function(e) {
if (e.oldDate === null) {
$(this).data('DateTimePicker').date(new Date(e.date._d.setHours(20, 00, 00)));
}
});
use this
$('#end').datetimepicker({
dateFormat: 'yy-mm-dd',
collapse:false,
sideBySide:true,
useCurrent:false,
showClose:true,
hour : '23',
minute :'00'
});
How to set the date for inline bootstrap datetimepicker.
I used jQuery ('#datetimepicker1').data('DateTimePicker).date('1/10/2017 12:34:24').
Is there any other way to set date and time since it throws error
@ramppt Please next time debug your code you have horrible error on your code:
jQuery ('#datetimepicker1').data('DateTimePicker).date('1/10/2017 12:34:24')
If you look very closely you have skipped a ' on this data('DateTimePicker)
As this a solution given that currently works this will be close and locked
Most helpful comment
Proposed workaround above erases the first selected date.
Corrected workaround: