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

behaviour of S.parseDate is unspecified for some inputs #488

Closed
davidchambers opened this issue Feb 15, 2018 · 0 comments

Comments

@davidchambers
Copy link
Member

commented Feb 15, 2018

MDN:

Note: parsing of date strings with the Date constructor (and Date.parse, they are equivalent) is strongly discouraged due to browser differences and inconsistencies. Support for RFC 2822 format strings is by convention only. Support for ISO 8601 formats differs in that date-only strings (e.g. "1970-01-01") are treated as UTC, not local.

#455 is an example of problems that arise when one relies on implementation-dependent behaviour.

It's possible that S.parseDate could reject strings in formats we know to be handled inconsistently. This may not be practical, in which case we should remove the function from the library. @syaiful6 raised the possibility of creating a dedicated library for parsing date strings in various formats. :)

📆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.