Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

French Canadian (locale="fr-CA") shows both 24 and 12 hour inputs #30

Closed
emilyuhde opened this issue Jun 12, 2019 · 6 comments · Fixed by #44
Closed

French Canadian (locale="fr-CA") shows both 24 and 12 hour inputs #30

emilyuhde opened this issue Jun 12, 2019 · 6 comments · Fixed by #44
Assignees
Labels
bug Something isn't working

Comments

@emilyuhde
Copy link
Contributor

emilyuhde commented Jun 12, 2019

I set the locale to locale="fr-CA" on the TimePicker I'm using and it shows the 24 hour input, 12 hour input, and then the minute input. I believe French speaking Canada uses the 24 hour clock (https://www.btb.termiumplus.gc.ca/redac-chap?lang=eng&lettr=chapsect1&info0=1.1.12) No AmPm select is shown, just the extra 12 hour input.

Screen Shot 2019-06-12 at 1 38 14 PM

@wojtekmaj wojtekmaj added the bug Something isn't working label Jun 14, 2019
@wojtekmaj
Copy link
Owner

Thanks for reporting this!

fr-CA time is formatted by Google Chrome as "21 h 13" instead of typical "21:13". After the time is formatted using a given locale, it is parsed and React-Time-Picker figures out what's what - and we end up with "H h mm" format, which causes this problem.

wojtekmaj added a commit that referenced this issue Jun 15, 2019
…in multiple inputs for the same thing

Could help with #30, but at the cost of less flexibility - no possibility for multiple inputs
@emilyuhde
Copy link
Contributor Author

emilyuhde commented Jul 11, 2019

I just upgraded to 3.6.0 and unfortunately I still see this issue happening. Did your commit you made related to this make it into the new release? @wojtekmaj

@wojtekmaj
Copy link
Owner

No, it did not, it sits on no-input-repeat branch. :( I was considering if decreasing flexibility by not allowing multiple inputs of the same type is a big deal or not.

@wojtekmaj wojtekmaj self-assigned this Jul 11, 2019
@emilyuhde
Copy link
Contributor Author

Hmm...maybe you could add in the functionality to only allow a single instance of each type of input, and have it be set with a prop. So it could default to how it currently works, but you could add a prop to turn on that no repeat functionality, so that would prevent it potentially breaking any users who depend on the current flexibillity.

@wojtekmaj
Copy link
Owner

Another idea that came to my mind is to disallow multiple inputs of the same type, but only in default format determined by locale prop. I don't think that's ever going to happen with default formats. This way, users will still be able to do whatever they are up to, while fixing this issue! Yaaaay!

wojtekmaj added a commit that referenced this issue Jul 11, 2019
…in multiple inputs for the same thing

Could help with #30, but at the cost of less flexibility - no possibility for multiple inputs
wojtekmaj added a commit that referenced this issue Jul 11, 2019
…in multiple inputs for the same thing (#44)

* Prevent render functions from being invoked more than once resulting in multiple inputs for the same thing

Could help with #30, but at the cost of less flexibility - no possibility for multiple inputs

* Allow render functions being invoked more than once for custom formats
@wojtekmaj
Copy link
Owner

Fix will be out with the next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants