-
Notifications
You must be signed in to change notification settings - Fork 171
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
Render 12/24 hour format according to user's preference #276
Comments
All sounds very reasonable. PRs welcome! |
I'll try. I think we could make it the default behaviour with an HTML attribute to opt-out, maybe call it |
It could be opt-out by explicitly setting Looks like it can also be overridden via |
Interesting find with $ eshost -e "new Intl.DateTimeFormat('en-gb-u-hc-h12', {hour: 'numeric'}).format()"
#### JavaScriptCore
1 PM
#### spidermonkey
1 pm
#### v8
1 pm
$ eshost -e "new Intl.DateTimeFormat('en-gb-u-hc-h23', {hour: 'numeric'}).format()"
#### JavaScriptCore
13
#### spidermonkey
13
#### v8
13 |
The element currently render the hour format according to the local of the provided
lang
attribute, which whenen
oren-US
will uses 12h clock format which is unexpected for users who are living in a region where the 24h format is the predominant format. See Wikipedia on which regions use which hour format.I therefor propose to render the hour format in the user's preferred format that they have set in their OS, as determinable by Intl APIs. Specifically
DateTimeFormat()
accepts ahour12
option and the option for this value is determinable via various means. There is also a newerhourCycle
option which also supports the 11-hour format, but this API is not yet widely supported in browsers.The text was updated successfully, but these errors were encountered: