Intl API formats date not in the specified format
Reported by
final.te...@gmail.com,
Feb 21 2017
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0 Steps to reproduce the problem: 1. Provide a UTC-based date in the official date format and construct it via JavaScript’s Date() function. 2. Convert the UTC-based date to a localDateString and replace the original with it in the DOM 3. Get an incorrect date format What is the expected behavior? The date format is expected to be displayed in the following way for the United Kingdom: - Short: dd/MM/y - Medium: d MMM y - Long: d MMMM y - Full: EEEE, d MMMM y This means that, as Firefox, Safari and other browsers display correctly, the datestring "2017-05-02T00:00:00+00:00" should be turned into "02/05/2017". Instead, Chrome returns just "2017-5-2". What went wrong? The date format is expected to be displayed in the following way for the United Kingdom, according to the system settings of macOS: - Short: dd/MM/y - Medium: d MMM y - Long: d MMMM y - Full: EEEE, d MMMM y This means that, as Firefox, Safari and other browsers display correctly, the datestring "2017-05-02T00:00:00+00:00" should be turned into "02/05/2017". Instead, Chrome returns just "2017-5-2", which is not specified anywhere. Did this work before? No Does this work in other browsers? Yes Chrome version: 58.0.3018.0 (Official Build) canary (64-bit) Channel: canary OS Version: OS X 10.12 Flash Version: Tested in Chrome stable as well as in Canary.
,
Feb 21 2017
If I change toLocaleDateString(); to toLocaleDateString('en-gb'); - it shows the expected string.
,
Feb 21 2017
(I do that because my locale is not United Kingdom)
,
Feb 27 2017
,
Feb 27 2017
,
Feb 28 2017
Unable to reproduce the issue on Mac 10.12.2 , Windows 7 & Ubuntu 14.04 using chrome reported version- 58.0.3018.0,stable-56.0.2924.87 & latest Canary-58.0.3025.0 as per the steps mentioned in comment#0 & comment#1. Observed same behaviour on Safari,firefox & chrome as the date format displayed in the format of "02/05/2017". Please find the attached screencast for reference & let us know if we miss anything to reproduce the issue. Thank you!!
,
Mar 9 2017
Gentle ping! final.technologies@ could you please respond on comment#6 and update the thread. Thanks.
,
Mar 20 2017
final.technologies@ could you please respond on comment#6 and update the thread. Thanks.
,
Mar 20 2017
#6, 7, 8 - Did you set your system locale to United Kingdom?
,
Apr 12 2017
WontFix until we get a response from the author. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by final.te...@gmail.com
, Feb 21 20171.2 KB
1.2 KB View Download