Timepicker Javascript displays time incorrectly

I have a timepicker div tag in my HTML as:   <input class="timepicker" name="timepicker" id="from-timepicker"/> Corresponding Javascript code:

$('#from-timepicker').timepicker({
            timeFormat: 'HH:mm',
            // year, month, day and seconds are not important
            minTime: new Date(0, 0, 0, 8, 0, 0),
            maxTime: new Date(0, 0, 0, 15, 0, 0),
            // time entries start being generated at 6AM but the plugin
            // shows only those within the [minTime, maxTime] interval
            startHour: 6,
            // the value of the first item in the dropdown, when the input
            // field is empty. This overrides the startHour and startMinute
            // options
            startTime: new Date(0, 0, 0, 8, 20, 0),
            // items in the dropdown are separated by at interval minutes
            interval: 10
        });

In the user interface, I see the time as:

0808:mm
I need it in 08:08 (hh:mm) format. 

Any idea where I'm wrong?

+4
source share
1 answer

timepicker format: 'timeFormat': 'h:i'

timepicker.jquery uses the php time part .

+2
source

All Articles