ntl.DateTimeFormat returns wrong date. The day is subtracted by one for different years
Reported by
antonstein91@gmail.com,
Jun 26 2018
|
|||||
Issue description
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/66.0.3359.181 Chrome/66.0.3359.181 Safari/537.36
Steps to reproduce the problem:
1.make a loop for formatting a date
for(i;i<100;i++){console.log(new Intl.DateTimeFormat('en-US', {year: 'numeric',month:'short',day:'numeric'}).format(new Date(1850+i, 1, 1)))}
2. check output see if your years range worked. If not try a different starting date.
3. happens for different lang-tags too
What is the expected behavior?
Expected:
Feb 1, YYYY
Happening:
VM245:1 Jan 31, 1877
VM245:1 Jan 31, 1879
VM245:1 Jan 31, 1880
VM245:1 Jan 31, 1881
VM245:1 Jan 31, 1882
VM245:1 Jan 31, 1883
VM245:1 Jan 31, 1884
VM245:1 Jan 31, 1885
VM245:1 Jan 31, 1886
VM245:1 Jan 31, 1887
VM245:1 Jan 31, 1888
VM245:1 Jan 31, 1890
VM245:1 Jan 31, 1891
VM245:1 Jan 31, 1892
VM245:1 Jan 31, 1893
VM245:1 Feb 1, 1894
VM245:1 Feb 1, 1895
VM245:1 Feb 1, 1896
VM245:1 Feb 1, 1897
VM245:1 Feb 1, 1898
VM245:1 Feb 1, 1899
VM245:1 Feb 1, 1900
VM245:1 Feb 1, 1901
What went wrong?
The out put should always be Feb 1, YYYY but it may also be Jan 31, YYYY that should not happen.
Also it does not seem to happen with more recent years
Did this work before? N/A
Chrome version: 66.0.3359.181 Channel: stable
OS Version: 17.04
Flash Version:
I am working on a contact editor atm and stumbled upon this issue as i was testing formatting birthday dates for years below 1960.
The behavior varies with the date. I could not figure what is causing this issue.
In other browsers this does not happen.
Kind regards
Anton
,
Jun 27 2018
Able to reproduce the issue on chrome reported version# 66.0.3359.181 using Ubuntu 14.04. But, unable to reproduce the issue on latest chrome stable# 67.0.3396.99. @Reporter: Could you please try to test this issue on latest chrome stable# 67.0.3396.99 and let us know if the issue still persists. You can download chrome latest stable from URL: https://www.chromium.org/getting-involved/dev-channel. Thanks!
,
Jul 2
I tested it with the latest chrome on windows and Ubuntu and it seems to be fine. I guess we have to wait till the the default chromium package for Ubuntu gets updated then. Regards Anton
,
Jul 2
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 2
,
Jul 3
As per comment #3, closing the issue as wontFix. Thanks...!! |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by viswa.karala@chromium.org
, Jun 26 2018