ryanburns23 / paper-time-input

Polymer element to accept a time with paper-input & paper-dropdown-menu
https://www.webcomponents.org/element/ryanburns23/paper-time-input
MIT License
16 stars 16 forks source link

Add the 24h format #1

Closed florent1933 closed 7 years ago

florent1933 commented 7 years ago

It would be great, if you can add the 24h format. I lived in France and we don't use the 12h format.

Congratulation for all your web components, it's a great work!

ryanburns23 commented 7 years ago

@florent1933 thank you for opening up this issue.

I closed it and added a max-hour property, set that to 24 and you should be good to go.

florent1933 commented 7 years ago

@ryanburns23 thanks for your quick work and reply.

florent1933 commented 7 years ago

In the 24h format, we don't use amPm so you should add an option to hide AM and PM and return a value like "23:02" and not "23:02am"

ryanburns23 commented 7 years ago

@florent1933 Okay, to solve this I kept it simple and replaced the maxHour property with format... format defaults to 12, set this to 24 for the following:

I added a 24 hour section to the demo as well. Let me know if I missed anything. Thanks!

florent1933 commented 7 years ago

Nearly ready 👍

One thing is missing : the name of the format is 24h, but the range of hours is 0-23. So 24:24 is invalid.

ryanburns23 commented 7 years ago

@florent1933 okay I think I got everything