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

date: add support for %q (quarter) in format string #7333

Closed
jfinkels opened this issue Feb 22, 2025 · 5 comments · Fixed by chronotope/chrono#1666
Closed

date: add support for %q (quarter) in format string #7333

jfinkels opened this issue Feb 22, 2025 · 5 comments · Fixed by chronotope/chrono#1666
Labels

Comments

@jfinkels
Copy link
Collaborator

Steps to reproduce:

date --date '2016-6-1' +%q

What happens now: uutils date terminates with an error message:

date: invalid format %q

What I expected to happen: GNU date prints the quarter number:

2

Notes: this is causing a failure in the GNU test file tests/date/date.pl.

@drinkcat
Copy link

Looks like %q format specifier is missing in chrono crate.

I'll have a look.

@drinkcat
Copy link

chronotope/chrono#1666 should do the trick.

With a local chrono checkout:

cargo run --config 'patch.crates-io.chrono.path="../chrono"' date --date '2016-6-1' +'%q'
...
2

@drinkcat
Copy link

Merged upstream. I guess we just need to wait for a release 0.4.40 now.

@drinkcat
Copy link

https://github.com/chronotope/chrono/releases/tag/v0.4.40 released. I assume the renovate bot will pick it up?

@cakebaker
Copy link
Contributor

Fixed by #7360

@drinkcat thanks for adding the functionality to chrono :)

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

Successfully merging a pull request may close this issue.

3 participants