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

Days of the week are not recognized #23

Open
cakebaker opened this issue Jun 20, 2023 · 6 comments
Open

Days of the week are not recognized #23

cakebaker opened this issue Jun 20, 2023 · 6 comments

Comments

@cakebaker
Copy link
Collaborator

GNU date recognizes days of the week and their three-letter abbreviations (plus tues, thur, and thurs), for example:

$ date --date="monday"
Mon Jun 26 12:00:00 AM CEST 2023
$ date --date="mon"
Mon Jun 26 12:00:00 AM CEST 2023
$ date --date="tuesday"
Tue Jun 20 12:00:00 AM CEST 2023
$ date --date="tue"
Tue Jun 20 12:00:00 AM CEST 2023

uutils date, using parse_datetime, doesn't recognize any days of the week and returns an "invalid date" error instead.

@philolo1
Copy link
Contributor

I will tackle this.

philolo1 added a commit to philolo1/parse_datetime that referenced this issue Aug 23, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
@tertsdiepraam
Copy link
Member

@philolo1 maybe before adding functionality we have to focus on the port to nom. If you want we can discuss with the author of that PR if you can adopt the PR.

@philolo1
Copy link
Contributor

@tertsdiepraam sure, do you have a link to the pr?

@tertsdiepraam
Copy link
Member

Here you go: #25

philolo1 added a commit to philolo1/parse_datetime that referenced this issue Aug 29, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
philolo1 added a commit to philolo1/parse_datetime that referenced this issue Aug 29, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
philolo1 added a commit to philolo1/parse_datetime that referenced this issue Aug 29, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
philolo1 added a commit to philolo1/parse_datetime that referenced this issue Aug 29, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
Use nom for parsing.
philolo1 added a commit to philolo1/parse_datetime that referenced this issue Aug 29, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
Use nom for parsing.
philolo1 added a commit to philolo1/parse_datetime that referenced this issue Aug 29, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
Use nom for parsing.
philolo1 added a commit to philolo1/parse_datetime that referenced this issue Sep 1, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
Use nom for parsing.
philolo1 added a commit to philolo1/parse_datetime that referenced this issue Sep 1, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
Use nom for parsing.
philolo1 added a commit to philolo1/parse_datetime that referenced this issue Sep 19, 2023
This commit resolves issue uutils#23.

Adds parse_weekday function that uses chrono weekday parser with a map for edge cases.
Adds tests cases to make sure it works correctly.
Use nom for parsing.
@xeruf
Copy link

xeruf commented Aug 15, 2024

any progress on merging this?

@tertsdiepraam
Copy link
Member

tertsdiepraam commented Aug 15, 2024

Unfortunately not. I'd love to look into it again but I'm not sure I can do that anytime soon. I'd be happy if someone would pick up my rewrite PR though.

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

4 participants