Open yonivy opened 4 years ago
I have a somewhat similar issue which I think is related to this, in that if a string is only partially parsed, no error is emitted.
For example, I tried to parse 2019-09-01_01:00:00
(using ParseStrict
), which ended up getting parsed as 2019-01-01 00:00:00 +0000
(only the year got parsed).
If there were unknown data in the string, I would have expected some sort of error to be thrown. As it is there is no way to tell if the date was properly recognized, which is important when handling human input.
Pretty much any string that satisfies the regex ^(\w+)(,\w+)+$
gets parsed as a valid date. We are having to exempt out that regex to use this library.
An working example can be found here. I also copied it here for reference.