Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

goog.date.UtcDateTime.fromIsoString adds 1900 to years with more than one leading zero #1143

Closed
p-himik opened this issue Sep 25, 2021 · 2 comments

Comments

@p-himik
Copy link

p-himik commented Sep 25, 2021

goog.date.UtcDateTime.fromIsoString('0000-10-15T23:50:58.165Z')
=> goog.date.UtcDateTime {date: Tue Oct 16 1900 02:04:26 GMT+0213 (Eastern European Summer Time)}

goog.date.UtcDateTime.fromIsoString('0009-10-15T23:50:58.165Z')
=> goog.date.UtcDateTime {date: Sat Oct 16 1909 02:04:26 GMT+0213 (Eastern European Summer Time)}

goog.date.UtcDateTime.fromIsoString('0099-10-15T23:50:58.165Z')
=> goog.date.UtcDateTime {date: Sat Oct 16 1999 02:50:58 GMT+0300 (Eastern European Summer Time)}

goog.date.UtcDateTime.fromIsoString('0999-10-15T23:50:58.165Z')
=> goog.date.UtcDateTime {date: Wed Oct 16 0999 02:04:26 GMT+0213 (Eastern European Summer Time)}

Related: #1142

@shicks
Copy link
Member

shicks commented Sep 30, 2021

I'm unable to reproduce this one using the latest NPM release: https://jsfiddle.net/L94g1tbh/

@shicks shicks closed this as completed Sep 30, 2021
@shicks
Copy link
Member

shicks commented Sep 30, 2021

That said, we should probably add test cases for this.

copybara-service bot pushed a commit that referenced this issue Oct 4, 2021
…d testcases from #1143

RELNOTES: n/a

PiperOrigin-RevId: 400776742
Change-Id: Ie66b9705029e359461d48c8ac7dc87b5b890b5d3
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants