Bug 133637

Summary: new Date().getFullYear().toLocaleString('ar or kr') The results are displayed in a comma.
Product: WebKit Reporter: ezBuilder <han314>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: andy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
The results by your browser. none

ezBuilder
Reported 2014-06-09 00:17:24 PDT
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.
Attachments
The results by your browser. (44.21 KB, image/png)
2014-06-09 00:19 PDT, ezBuilder
no flags
ezBuilder
Comment 1 2014-06-09 00:19:07 PDT
Created attachment 232696 [details] The results by your browser.
Andy VanWagoner
Comment 2 2018-07-27 10:33:07 PDT
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"
Note You need to log in before you can comment on or make changes to this bug.