| Summary: | new Date().getFullYear().toLocaleString('ar or kr') The results are displayed in a comma. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | ezBuilder <han314> | ||||
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED INVALID | ||||||
| Severity: | Normal | CC: | andy | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
Created attachment 232696 [details]
The results by your browser.
Since this ticket was created ECMA 402 Internationalization API has been adopted by all these browsers.
Depending on your locale, the grouping separator will be included in localized numbers. You can always request it not be included, though
new Date().getFullYear().toLocaleString('ar', { useGrouping: false })
"٢٠١٨"
Most locales won't use grouping separators when they know they are formatting a year. There may also be additional characters used to show it is a year. For this specific use case, you'd probably be better off doing:
new Date().toLocaleString('ko', { year: 'numeric' })
"2018년"
instead of
new Date().getFullYear().toLocaleString('ko', { useGrouping: false })
"2018"
|
new Date (). getFullYear (). toLocaleString ('ar') new Date (). getFullYear (). toLocaleString ('ko') new Date (). getFullUTCYear (). toLocaleString ('ar') new Date (). getFullUTCYear (). toLocaleString ('ko') Currently, the latest version of CHROME, IE, FF, SAFARI the results of running the above code is stamped out a comma. I wonder why the comma is visible too.