Bootstrap 3 DateTimepicker Display TimePicker First

I am working with a date and time indicator found here:

http://eonasdan.imtqy.com/bootstrap-datetimepicker/

Maybe the answer is right in front of me, but I can’t find it. How do you show the time editing screen first by default? I create an application for storing time and rarely change the date, but usually change the time.

Thanks for any help!

+6
source share
3 answers

Ok, this is a bit of hockey, but based on the answer here:

https://github.com/Eonasdan/bootstrap-datetimepicker/issues/840

I added

$(".datetimepicker").on 'dp.show',() β†’ $(document).find('.picker-switch a[data-action="togglePicker"]').click()

to my coffee. Jquery equivalent will be

 $(".pickthetime").on('dp.show', function(){ $(document).find('.picker-switch a[data-action="togglePicker"]').click() }); 

It's kind of what I'm looking for, but the movement of the slider makes it a little shitty. Any thoughts?

+5
source

Since you rarely change the date, perhaps using a timepicker would be more appropriate for your project. You may also have a separate collector.

Bootprap timepicker

I found:

Bootprap Datepicker Docs

The default value for all parameters can be changed directly by changing the values ​​in the hash of $ .fn.datepicker.defaults:

 $.fn.datepicker.defaults.format = "mm/dd/yyyy"; $('.datepicker').datepicker({ startDate: '-3d' }) 

Change the format string to:

 "HH:MM:SS mm/dd/yyyy" 
0
source

All Articles