pendulum icon indicating copy to clipboard operation
pendulum copied to clipboard

v2 cannot parse standard US MM/DD/YYYY format

Open bmeredyk opened this issue 8 years ago • 1 comments

The docs state "The library natively supports the RFC 3339 format, most ISO 8601 formats and some other common formats." Yet it cannot parse the standard MM/DD/YYYY (i.e. today is 07/16/2018) format as commonly used in the USA. More annoyingly, this format previously worked with v1 causing unexpected breakages upon upgrade. Sure you can use .from_format(input_string, 'MM/DD/YYYY') but that defeats the purpose of having a parser that'll generally work if you feed it a reasonable string.

bmeredyk avatar Jul 16 '18 19:07 bmeredyk

If you want to retrieve the previous behavior, you can pass strict=False to parse() (like mentionned in the docs: https://pendulum.eustace.io/docs/#parsing or in the Pendulum 2.0 annoucement: https://pendulum.eustace.io/blog/pendulum-2.0.0-is-out.html). And the goal of the parser is not to accept any strings that's why it has been made stricter in version 2.0.

sdispater avatar Jul 30 '18 20:07 sdispater