date: date setting format error
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
The coreutils version currently uses the parse_datetime crate to parse the date source which parses in YYYYMMDDHHMM and similar formats. However it is not compliant with date:
Usage: date [OPTION]... [+FORMAT]
or: date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
Display date and time in the given FORMAT.
With -s, or with [MMDDhhmm[[CC]YY][.ss]], set the date and time.
GNU:
$ date 11111111
Mon 11 Nov 2024 11:11:00 AEDT
coreutils
$ cargo run --release -p uu_date -- 11111111
target/release/date: invalid date '11111111'
Since it is interpreting the first 1111 as the year.
Note: date -s STRING is compliant with GNU the version, only the positional argument format is affected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the uu_date command's positional date-argument handling and inspect how the parse_datetime crate is used for that path. Compare the GNU positional format with the current behavior for 11111111, while preserving the existing date -s STRING behavior; done means this input is accepted in the expected month/day format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100