[Webkit-unassigned] [Bug 133637] new Date().getFullYear().toLocaleString('ar or kr') The results are displayed in a comma.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 27 10:33:07 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=133637

Andy VanWagoner <andy at vanwagoner.family> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andy at vanwagoner.family
         Resolution|---                         |INVALID

--- Comment #2 from Andy VanWagoner <andy at vanwagoner.family> ---
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"

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180727/726b6788/attachment-0001.html>


More information about the webkit-unassigned mailing list