Closed colmanhumphrey closed 3 years ago
Fixes #14
Previously, if all the patterns failed, the default was to return the result of parseISO. But that could also fail to parse, returning "Invalid Date".
parseISO
"Invalid Date"
So now this also checks if that final value is valid, and if not, returns null.
Question: should it be null, or undefined, or doesn't matter?
Other stuff (minor):
example/data.js
plaindate
parseDatetimeString
Happy to do any other edits here too, e.g. let me know about version numbers etc
this is great, thanks @ColmanHumphrey!
Fixes #14
Previously, if all the patterns failed, the default was to return the result of
parseISO
. But that could also fail to parse, returning"Invalid Date"
.So now this also checks if that final value is valid, and if not, returns null.
Question: should it be null, or undefined, or doesn't matter?
Other stuff (minor):
example/data.js
for quick viewing, also added aplaindate
type here tooparseDatetimeString
doesn't then loop through the remaining pattternsHappy to do any other edits here too, e.g. let me know about version numbers etc