Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Conversation

@dimalama
Copy link

@dimalama dimalama commented Oct 6, 2015

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.

…e consistent with 24h format when it works with am/pm time format.
@jboesch
Copy link
Contributor

jboesch commented Oct 6, 2015

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

@dimalama
Copy link
Author

dimalama commented Oct 6, 2015

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.

@Squazz
Copy link

Squazz commented Nov 20, 2015

@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

@jboesch
Copy link
Contributor

jboesch commented Nov 20, 2015

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

@dimalama
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants