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

goog.date.UtcDateTime.fromIsoString does not support extended year #1142

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

goog.date.UtcDateTime.fromIsoString does not support extended year #1142

p-himik opened this issue Sep 24, 2021 · 2 comments
Assignees

Comments

@p-himik
Copy link

p-himik commented Sep 24, 2021

According to a reference of Date.toISOString, the format is either YYYY-MM-DDTHH:mm:ss.sssZ or ±YYYYYY-MM-DDTHH:mm:ss.sssZ.
However, only the former is supported:

(new Date(-1, 1)).toISOString()
=> '-000001-01-31T21:46:32.000Z'
goog.date.UtcDateTime.fromIsoString((new Date(-1, 1)).toISOString())
=> null
@12wrigja
Copy link
Collaborator

For what it's worth, you may find your date/time manipulation needs better solved by Temporal, for which there are several polyfills available.

@shicks
Copy link
Member

shicks commented Oct 5, 2021

We also have an issue with the formatting - it should always pad the year to 4 unsigned or 6 signed digits, and currently it does not.

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

3 participants