any-date-parser icon indicating copy to clipboard operation
any-date-parser copied to clipboard

Valid date being marked invalid

Open amcdnl opened this issue 2 years ago • 2 comments

The following date results in invalid status:

2022-05-25T16:03:12.2085

when using this:

dateParser.fromAny("2022-05-25T16:03:12.2085");

will return this:

{invalid: 'Unable to parse 2022-05-25T16:03:12.2085'}invalid: "Unable to parse 2022-05-25T16:03:12.2085"[[Prototype]]: Object

but a normal date constructor works fine:

image

amcdnl avatar May 25 '22 17:05 amcdnl

date

Same thing happens today on Windows, Chrome and iPhone's Safari. Macbook's Chrome parsing ok.

upd: Found problem, something with the locales, like half of them are not being parsed properly. For example, English & CM works ok, ZA, RU, ET, ER, don't. That's only few that I've randomly selected from the full list. Fixed by adding 'en' locale as second argument in the parse functions.

kolmakova avatar May 26 '22 13:05 kolmakova

@kolmakova Given that you didn't have some locales installed, can you clarify what is the current behavior and desired behavior?

kensnyder avatar Jun 01 '22 21:06 kensnyder