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

Clock module format string regression: doesn't support some common date formats #1447

Open
aphex-vim opened this issue Feb 28, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@aphex-vim
Copy link

After upgrading from 0.9.9-1 -> 0.9.9-2 from the Arch Linux repository, waybar omits my clock#time module but still draws my clock#date module with no trouble. The only error message I get when running the bar from a shell is [error] : invalid format, which makes it sound like the config has a JSON syntax error, but it worked fine in the previous version.

I prefer to have the time alone in the modules-center, and my date off to the side in modules-right. The only fix I've found to keep the format I want is to downgrade to 0.9.9-1.

This is one of my first GitHub issues, so if any more information would be helpful just let me know and I can include it. Attached are my config stylesheet.

config.txt
style.txt
.

@randre03
Copy link

randre03 commented Mar 1, 2022

appears to be similar to #1439. I had to change the time format to use %R to get it to work.

@chris-morgan
Copy link

I filed this as https://bugs.archlinux.org/task/73982, looks like here’s the right place now, as it affects anyone building from source with up-to-date dependencies.

So %l (space-padded hour, 1–12; as an aside, I’ve always found it quite baffling that there’s mostly no unpadded hour figure in strftime—though glibc has %-I for the purpose) and %P (am/pm, lowercase unlike %p) have become broken in some dependency of this.

Actually, referring to a disgruntled comment I put in my ~/.config/waybar/config: %l and %P were already broken in clock’s tooltip-format, but worked in format. These sorts of inconsistencies (this, pango markup working in some places but not others, that kind of thing) are rather frustrating.

I suggest retitling this issue to mention that it’s a clock format string regression.

For now, I’ll stick with Arch’s 0.9.9-1 package.

@aphex-vim aphex-vim changed the title [error] : invalid format with two clock modules Clock module format string regression: doesn't support some common date formats Mar 2, 2022
@Alexays Alexays added the bug Something isn't working label Mar 8, 2022
@euclio
Copy link
Contributor

euclio commented Mar 15, 2022

According to fmtlib/fmt#2811, the std::tm formatter intentionally no longer supports system-defined specifiers like %-I.

@tkna91
Copy link

tkna91 commented Jul 28, 2022

I was able to achieve this without using the Clock module as follows. Please refer to the following if there is no problem.
image

~/.config/waybar/config

    "custom/clock"
    "custom/clock": {
        "format": "{}",
        "interval": 5,
        "exec": "date +%-m/%d\\(%a\\)%-H:%M",
    },

~/.config/waybar/style.css

#custom-clock,
#custom-clock {
    font-weight: bold;
    background-color: @theme_bg_color;
}

@LukashonakV
Copy link
Contributor

LukashonakV commented Feb 23, 2023

Hi @spencer-maaaaan, @chris-morgan, @randre03, @euclio, @tkna91 , please see #1469 (comment)

@LukashonakV
Copy link
Contributor

Hi @spencer-maaaaan , can you close the issue as a duplicate pf #1469 please?

@chris-morgan
Copy link

It should be the other way round: this covers the entire range of regressions (%0I, %-I, %P, and anything else, frankly), whereas #1469 only covers %0I (… and it even misspells it as %OI in its title!).

(In light of the successful landing of glibc padding stuff, I’ve submitted a patch for %P in fmtlib/fmt#3314.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants