Comments (8)
The specification references to DefaultLocale()
abstract operation http://tc39.github.io/ecma402/#sec-defaultlocale, but that is not exposed today. We can probably start by doing so, and expand on other default values (coming from the host environment).
from ecma402.
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.)
from ecma402.
I also don't understand why this can't be part of HTML spec, especially that Intl doesn't have any event handling code.
from ecma402.
There's another setting that we need - timechange
. We use it in Firefox OS as moztimechange
for now and it is fired when either time or timezone is manually changed.
I wouldn't mind separating those two but they seem very similar to hour12
setting, timeformatchange
and languagechange
.
from ecma402.
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 Intl.DateTimeFormat.defaultResolvedOptions()
for a standard place for these, rather than making one-off navigator properties.
@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!
from ecma402.
@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.
from ecma402.
@littledan - unfortunately, there's no easy way to expose something that we can remove later.
Our current thinking is that we will expose moztimeformatchange
and navigator.mozHour12
for now and moztimechange
for time/timezone changes.
I'm not a huge fan of it, I believe that we'll need some WebAPI with navigator.userPreferences
or navigator.settings
with event listeners and simple options like bools/enums because there are more and more user settings that should be accessible to web apps.
But I don't see any progress on any API of that kind right now :/
from ecma402.
BCP47 with CLDR extensions specifies here es-US-u-hc-h12
(12 hour) / es-US-u-hc-h24
(24 hour). Perhaps that could be used as an interchange format.
from ecma402.
Related Issues (20)
- Consider making ResolveLocale return the normalized requested locale instead of the available locale HOT 6
- Default of ignorePunctuation need to be locale dependent HOT 3
- Support cash rounding HOT 3
- Displaying wrong date format for sr-Latn-me locale HOT 2
- Intl.NumberFormat with style: 'decimal' if the number has four digits, does not add the point on locale spanish HOT 1
- Should intrinsics be scoped? HOT 3
- Need support for nigerian currency. HOT 3
- Add option to use variant era names HOT 1
- Intl API for parsing locale aware strings HOT 2
- Inconsistency in definition of "calendar types" HOT 1
- Decimal integration HOT 1
- How to use ecma402 Intl.GetCanonicalLocales in Android HOT 1
- Intl.NumberFormat() - narrowSymbol issue in en-CA culture, USD currency HOT 6
- Intl.DateTimeFormat.prototype.formatRange and time only range display
- Intl.DateTimeFormat.prototype.formatRange and time only range display HOT 3
- Intl.DisplayNames dateTimeField - add Today, Yesterday and Tomorrow HOT 2
- Intl.DateTimeFormat error with formatRange HOT 2
- Find a replacement for indirect field reference HOT 1
- ResolvedLocale locale string manipulation is confusing and inconsistent
- List of ISO country codes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecma402.