jQueryTimeAutocomplete icon indicating copy to clipboard operation
jQueryTimeAutocomplete copied to clipboard

Added match_24h_format option which changes the plugin behaviour to b…

Open dimalama opened this issue 9 years ago • 5 comments

Added match_24h_format option which changes the plugin behaviour to be consistent with 24h format when it works with am/pm time format. If match_24h_format is true the plugin behaves next way: when an user enters 12, it becomes 12PM, because this would be consistent with the 24h time format. Also the plugin accepts 0 as 12AM.

dimalama avatar Oct 06 '15 02:10 dimalama

Not exactly sure what this does. Can you amend with some tests? Existing ones to add to can be found in /tests

jboesch avatar Oct 06 '15 02:10 jboesch

Basically when match_24h_format option is true then the plugin works the next way for example if an user enters 12 the plugin makes next select suggestion ["12:00 PM", "12:15 PM", "12:30 PM", "12:45 PM", "12:00 AM", "12:15 Am", "12:30 AM", "12:45 AM"] instead of ["12:00 AM", "12:15 Am", "12:30 AM", "12:45 AM", "12:00 PM", "12:15 PM", "12:30 PM", "12:45 PM"]. If the user enters 1223 the plugin will convert it to 12:23 PM instead of 12:23 AM, if user enters 0 the plugin converts it to 12:00 AM instead of entering 00.

I'm using the current plugin for a project and QA made the next request "When user enters 12, it becomes 12AM. It should become 12PM, because this would be consistent with military time. System should accept 0 as 12AM."

The match_24h_format plugin option will cover that use case when there is need for it by set it to true by default it is false.

dimalama avatar Oct 06 '15 03:10 dimalama

@dlukianenko from what I see, when this is enabled, the suggestions in the dropdown still starts with 12:00AM, if you then tab out it is counter-intuiative that the first selected element (with AM) is then turned into PM

Squazz avatar Nov 20 '15 09:11 Squazz

Please provide tests to help get this sucker merged. I do appreciate your help!

jboesch avatar Nov 20 '15 23:11 jboesch

Sorry folks, I was busy with work. I will write the tests during upcoming weekends

dimalama avatar Nov 21 '15 01:11 dimalama