Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several issues with the ISO-8601 date/time parser #2323

Open
benwilber opened this issue Apr 3, 2024 · 0 comments
Open

Several issues with the ISO-8601 date/time parser #2323

benwilber opened this issue Apr 3, 2024 · 0 comments

Comments

@benwilber
Copy link

benwilber commented Apr 3, 2024

The T separator is just convention. It can be any single character.

https://github.com/Urigo/graphql-scalars/blob/master/src/scalars/iso-date/formatter.ts#L21

Parsing milliseconds with this regex is not allowing comma , separator, only dot .

https://github.com/Urigo/graphql-scalars/blob/master/src/scalars/iso-date/formatter.ts#L49

It also doesn't appear to handle 2-digit timezones. ie +00 instead of +0000

Postgres default timestamptz formatter returns strings like 2024-04-01 01:00:00,000+00

So this library will fail to parse that in at least 3 different ways, even though it's perfectly valid ISO-8601 format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant