Skip to content
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

Lowercase month name not parseable #768

Open
Odaeus opened this issue Dec 17, 2024 · 0 comments
Open

Lowercase month name not parseable #768

Odaeus opened this issue Dec 17, 2024 · 0 comments

Comments

@Odaeus
Copy link

Odaeus commented Dec 17, 2024

Hello,

Steps to reproduce

> Timex.parse("march", "{Mfull}")
{:error, "Expected `full month name` at line 1, column 6."}
> Timex.parse("mar", "{Mshort}")
{:error, "Expected `month abbreviation` at line 1, column 4."}

Description of issue

It's surprising that this fails due to the names being completely lowercased. We first discovered this issue while attempting to parse a date with an uppercase month (like "17-DEC-2024"), realised there is no support for that in the parser, but noticed that lowercase is supported by Timex.month_to_num:

> Timex.month_to_num("MAR")
{:error, :invalid_month_name}
> Timex.month_to_num("mar")
3

But this doesn't work in the parser. I would likely be able to contribute if a PR to update this is acceptable?

Thanks!
Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant