W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2015

[dom] Read-only OS time formatting preferences

From: Zibi Braniecki via GitHub <sysbot+gh@w3.org>
Date: Mon, 21 Sep 2015 08:20:47 +0000
To: www-dom@w3.org
Message-ID: <issues.opened-107463930-1442823644-sysbot+gh@w3.org>
zbraniecki has just created a new issue for 
https://github.com/whatwg/dom:

== Read-only OS time formatting preferences ==
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:

```
(new Date()).toLocaleString(navigator.languages, {
  hour12: navigator.mozHour12,
  hour: 'numeric',
  minute: 'numeric'
});
```

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`.

See https://github.com/whatwg/dom/issues/79
Received on Monday, 21 September 2015 08:20:48 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:24 UTC