i3status-rust icon indicating copy to clipboard operation
i3status-rust copied to clipboard

Add ordinals support to time block

Open breadcat opened this issue 3 years ago • 2 comments

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.

breadcat avatar Oct 27 '21 12:10 breadcat

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

ammgws avatar Oct 27 '21 12:10 ammgws

Some discussion here: https://github.com/chronotope/chrono/issues/281

ammgws avatar Oct 27 '21 12:10 ammgws