i3status-rust
i3status-rust copied to clipboard
Add ordinals support to time block
Hello,
I was wondering if it were possible to get ordinals support in the time block? Currently, I'm using the following custom block:
date '+%A %eXX %B, %H:%M' | sed -e 's/11XX/11th/' -e 's/12XX/12th/' -e 's/13XX/13th/' -e 's/1XX/1st/' -e 's/2XX/2nd/' -e 's/3XX/3rd/' -e 's/XX/th/'
Which gives me Wednesday 27th October, 12:58
but I was hoping to get this built into the existing block.
If chrono-rs implemented a format specifier for it then it should work without doing anything on our side. Try looking into whether they would do that?
https://docs.rs/chrono/0.4.19/chrono/format/strftime/index.html#specifiers
Some discussion here: https://github.com/chronotope/chrono/issues/281