-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Intl.DateTimeFormat add timeZone data
- Loading branch information
1 parent
f902678
commit f44fbe2
Showing
6 changed files
with
8,442 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#### Dependencies | ||
dependencies = [ | ||
"Intl.DateTimeFormat" | ||
] | ||
|
||
#### Specification Link | ||
spec = "https://tc39.es/ecma402/#sec-initializedatetimeformat" | ||
|
||
#### Documentation Link | ||
docs = "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options" | ||
|
||
#### License | ||
license = "MIT" | ||
|
||
#### Notes | ||
notes = [ | ||
"See formatjs documentation for more info on 'golden' vs 'all' timezones. https://formatjs.io/docs/polyfills/intl-datetimeformat" | ||
] | ||
|
||
#### Browser compatibility | ||
[browsers] | ||
android = "*" | ||
ie = "9 - *" | ||
ie_mob = "9 - *" | ||
edge = "<79" | ||
edge_mob = "<79" | ||
firefox = "*" | ||
opera = "*" | ||
chrome = "<76" | ||
safari = "*" | ||
ios_saf = "*" | ||
firefox_mob = "*" | ||
samsung_mob = "*" | ||
|
||
[install] | ||
module = "@formatjs/intl-datetimeformat" | ||
paths = [ "/add-all-tz.js" ] | ||
clean = [ | ||
"polyfill.js", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(function (global) { | ||
if ('Intl' in global && 'DateTimeFormat' in global.Intl && 'format' in global.Intl.DateTimeFormat.prototype) { | ||
try { | ||
return (new Intl.DateTimeFormat('en', { | ||
timeZone: 'Africa/Dakar', | ||
timeZoneName: 'short' | ||
}).format(new Date(Date.UTC(2012, 11, 20, 3, 0, 0, 200))).slice(-3) === 'GMT'); | ||
} catch(e) { | ||
return false; | ||
} | ||
} | ||
|
||
return false; | ||
}(self)) |
Oops, something went wrong.