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

Hour without leading zero in clock module? #3097

Open
tmpm697 opened this issue Mar 30, 2024 · 6 comments
Open

Hour without leading zero in clock module? #3097

tmpm697 opened this issue Mar 30, 2024 · 6 comments

Comments

@tmpm697
Copy link

tmpm697 commented Mar 30, 2024

hi, it seems that i can't set to have hour without leading zero with clock module @alttabber @LukashonakV
it will echo clock: chromo format erorr: invalid specifier in chromo-specs

I have:

"format": "{:%a %b %d %-H:%I %p}",

expect output: Sun Mar 31 1:20 AM --> no leading zero in hour 1

@ordy
Copy link
Contributor

ordy commented Mar 30, 2024

See #1469 (also fmtlib/fmt#3572)

Have to wait for next fmt release a new update to support %-H and %-I.

@hhhorb
Copy link

hhhorb commented Apr 23, 2024

@alttabber
Copy link
Contributor

Still an issue with today's release...

It's an upstream problem with https://github.com/fmtlib/fmt, if you wanna bug someone bug them.

@hhhorb
Copy link

hhhorb commented May 8, 2024

@alttabber, I'm not trying to bug anybody, I'm just trying to get a clock display that 300 million Americans use daily. Also the UK, Ireland, Canada, Australia, Japan, India, Philippines, Mexico... I think even those old analog flip clocks with the digital chiclets in the '80s had a blank chiclet for 1-9 o'clock. I'm trying to get a clock display that I can get on every other clock applet and panel I've used. Nobody who uses a 12-hour clock displays it or says it as 02 o'clock.

I don't understand,is this not a regression...

#1469

So apparently this worked in waybar 9.12 or before. And entering date +%l:%M in a terminal displays the time properly...

❯ date +%l:%M
 1:19

If this is a fmt issue and they've stalled on it...
fmtlib/fmt#2959

... why continue to use that library for waybar-clock? Like I said, xfce4-panel, GNOME, KDE, lxpanel, tint2, awesome panel, conky, etc... all can display a 12-hour clock without a leading zero.

@jayache80
Copy link

Recommend collapsing this issue with #1469

libfmt has supported stripping the leading zero using - (e.g. {:%-I:%M}) since Feb of 2023:

commit 7718eeeacc98c2dfb6fe8714fb38ef31f2921ab9
Author: Shawn Zhong
Date:   Wed Feb 8 11:22:58 2023 -0600

    Implement glibc ext for sec, min, and hour (#3271)

But you'd want a new libfmt release before you'd want to use it (latest libfmt release 10.2.1 has this bug which is fixed but not released).

Once that's released, then waybar project would have to pick up that release.

@hhhorb
Copy link

hhhorb commented May 18, 2024

@jayache80, thanks much for the update.

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

No branches or pull requests

5 participants