Skip to content

Allow uppercase for words like "today", "next", etc. #134

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

Merged
merged 1 commit into from
Apr 26, 2025

Conversation

dan-hipschman
Copy link
Contributor

@dan-hipschman dan-hipschman commented Apr 26, 2025

I noticed this while working on tests:

$ date -d "today"
Sat Apr 26 07:20:14 AM PDT 2025

$ cargo run -q date -d "today"
Sat Apr 26 07:20:31 PDT 2025

$ date -d "TODAY"
Sat Apr 26 07:20:37 AM PDT 2025

$ cargo run -q date -d "TODAY"
date: invalid date 'TODAY'

This PR fixes that.

Note, I originally considered just doing .to_lowercase() in coreutils date, but this will also lowercase the timezone and ISO separators (e.g., T in `2025-04-26T07:26). It appears that chronos then can't parse this:

$ cargo run -q date -d "2025-04-26t07:28:04-07:00"
date: invalid date '2025-04-26t07:28:04-07:00'

Not to mention parse_datetime as a standalone crate should be case insensitive, I think.

@cakebaker cakebaker merged commit b6795d9 into uutils:main Apr 26, 2025
14 checks passed
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (b9630d4) to head (3bdafeb).
Report is 2 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #134   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cakebaker
Copy link
Collaborator

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants