-
Notifications
You must be signed in to change notification settings - Fork 108
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
Expose datetime formatting user preferences #38
Comments
The specification references to |
My proposal in #38 (comment) was for integrating this into HTML. I don't think WebIDL is used in ecma402, so we need someone else make a proposal here (but I still don't understand why we don't do this in HTML.) |
I also don't understand why this can't be part of HTML spec, especially that Intl doesn't have any event handling code. |
There's another setting that we need - I wouldn't mind separating those two but they seem very similar to |
This bug has been reported to Chrome multiple times, e.g., https://code.google.com/p/chromium/issues/detail?id=360156 . Users seem to expect that their system preferences will be automatically propagated to methods like .toLocaleDateString() without having to propagate individual options through navigator to the method explicitly. It seems to me like we could let the surrounding embedding context supply the meaning of 'undefined', rather than making it always provided by the locale, if 'undefined' is given for the locale. Or maybe we could have an @zbraniecki I think it'd be better if Mozilla would develop these new APIs without a vendor prefix. We've found these really hard to remove in the past! |
@littledan this issue goes beyond browsers, on the server side, it gets really tricky because the system-preferences are not useful, we have been tracking this here nodejs/Intl#14 In any case, we will move forward with the initial plan from last meeting, providing access to the settings, and the first step. |
@littledan - unfortunately, there's no easy way to expose something that we can remove later. Our current thinking is that we will expose But I don't see any progress on any API of that kind right now :/ |
BCP47 with CLDR extensions specifies here |
Cloned from whatwg/html#171
All operating systems allow user to select time format. Usually between 12h, 24h or follow automatic.
Firefox OS is currently providing navigator.mozHour12 that can take true/false/undefined values and that nicely fits into Intl API:
When "use default" is used, mozHour is undefined and Intl uses the default hour12 value for the given locale. If mozHour is specified to either true or false, Intl API follows that.
There's also an event associated with it: timeformatchange that is dipatched on window.
We're not yet sure if it should be part of Ecma 402 or HTML spec because of events, but I'm opening the issue here to start the conversation in case the HTML group will throw it here.
I can see us wanting to design the API to handle more than one preference or just follow @ehsan's proposal from the HTML issue:
The text was updated successfully, but these errors were encountered: