Problem with Bootprap Twitter

I am trying to get Twitter timestick Bootstrap to work. My code is below:

$('.timepicker').timepicker({ // defaultTime: 'current', defaultTime: $(this).val(), minuteStep: 1, disableFocus: true, template: 'dropdown' }); 

The default time is displayed correctly from the database, but when I click on this field to try to change the time during which the time counter is empty. If I try to move the hour or minute inputs, they display "NaN". AM / PM input is displayed correctly after moving. Is there a setting that I need to configure for it to work? Thanks!

+4
source share
3 answers

Try the following: defaultTime: false,

 $('#time_app').timepicker({ defaultTime: false, minuteStep: 30, showInputs: false, disableFocus: true, modalBackdrop: true }); 
+1
source

Use value in defaultTime and assign value to input and it will work

 <input class="timepicker" type="text" class="input-small" value="00:00"> 

JQuery

 $(document).ready(function(){ $('.timepicker').timepicker({ defaultTime: 'value', minuteStep: 1, disableFocus: true, template: 'dropdown' }); }); 
0
source

You can try updating the default time in the input field.

 <input id="timepicker1" type="text" class="input-small" value="00:00 AM"/> 

Demo: Fiddle

0
source

All Articles