jonthornton / jquery-timepicker

A javascript timepicker plugin for jQuery inspired by Google Calendar.
https://www.jonthornton.com/jquery-timepicker
MIT License
1.88k stars 643 forks source link

Doesn't work properly with input type=time #755

Closed dev-softwareistic closed 2 years ago

dev-softwareistic commented 3 years ago

This is my html DOM <input id="timePicker" type="time" class="time" />

And this is my script var timepicker = $('#timePicker').timepicker({ 'timeFormat': 'h:i a', 'step': 30 });

And that's the warning I am getting when pick any time from picker and the selected value is not setting up on picker The specified value "01:30 am" does not conform to the required format. The format is "HH:mm", "HH:mm:ss" or "HH:mm:ss.SSS" where HH is 00-23, mm is 00-59, ss is 00-59, and SSS is 000-999.

jonthornton commented 3 years ago

Try it with a 24hr time format and no am/pm

var timepicker = $('#timePicker').timepicker({ 'timeFormat': 'H:i', 'step': 30 });

dev-softwareistic commented 3 years ago

Yes it worked, but the requirement is 1-12 with am/pm. Is there any way of doing that with your plugin?

jonthornton commented 3 years ago

I'm not sure the plugin is the issue. Can you get that time format working on input type=time without the plugin?