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
Add string as possible input date arguments. #1836
Comments
Unfortunately, string type from most functions was removed in v2.0.0-beta+ :( |
Just in case the maintainers are still second guessing their decision, I wanted to chime in here in favor of supporting fully-formed ISO strings. The reason to remove the The maintainer's response is essentially that JS will not throw if you give it an invalid string, i.e. Storing dates as ISO strings is very common, and converting them to numeric timestamps (either at the db level or in memory) just to use with this library is a disappointing requirement. |
I agree, allowing for full ISOStrings would be great. |
The current type of the date argument of all or the most functions is
date: number | Date
.My suggestion:
date: number | Date | string
. (mostly ISO string or other valid strings for the Date constructor.)date-fns 2.13.0
The text was updated successfully, but these errors were encountered: