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

Calendar shows wrong week numbers #2331

Closed
J0nnyMak0 opened this issue Jul 19, 2023 · 6 comments
Closed

Calendar shows wrong week numbers #2331

J0nnyMak0 opened this issue Jul 19, 2023 · 6 comments

Comments

@J0nnyMak0
Copy link

J0nnyMak0 commented Jul 19, 2023

I'm using the default calendar format from man waybar-clock and I think the week numbers are wrong. Unless I'm missing something, the week number of the last week of the month should repeat at the first week of the following month (unless the first day of the month is a Sunday). However, currently the week number of the first and second weeks of the month repeat (if month doesn't start on a Sunday) and every month gets a new first week number.

      "calendar": {
                  "mode"          : "year",
                  "mode-mon-col"  : 3,
                  "weeks-pos"     : "right",
                  "on-scroll"     : 1,
                  "on-click-right": "mode",
                  "format": {
                              "months":     "<span color='#ffead3'><b>{}</b></span>",
                              "days":       "<span color='#ecc6d9'><b>{}</b></span>",
                              "weeks":      "<span color='#99ffdd'><b>W{}</b></span>",
                              "weekdays":   "<span color='#ffcc66'><b>{}</b></span>",
                              "today":      "<span color='#ff6699'><b><u>{}</u></b></span>"
                              }
            }

waycal

@LukashonakV
Copy link
Contributor

Hi @J0nnyMak0 , can you please share additional info:

  1. date '+%c'
  2. echo $LANG
  3. waybar --version
  4. uname -a
  5. Please provide here the whole block for clock module

@J0nnyMak0
Copy link
Author

Hi @J0nnyMak0 , can you please share additional info:

  1. date '+%c'

Wed 19 Jul 2023 10:13:02 AM CDT

  1. echo $LANG

en_US.UTF-8

  1. waybar --version

Waybar v0.9.19-39-g1e2b9cb5 (branch 'master')

  1. uname -a

Linux jonmhome 6.4.3-arch1-2 #1 SMP PREEMPT_DYNAMIC Sat, 15 Jul 2023 19:25:49 +0000 x86_64 GNU/Linux

  1. Please provide here the whole block for clock module
        "clock": {
                "timezone": "America/Chicago",
                "format": "{:%a}",
                "tooltip-format": "<tt><small>{calendar}</small></tt>",
                "calendar": {
                  "mode"          : "year",
                  "mode-mon-col"  : 3,
                  "weeks-pos"     : "right",
                  "on-scroll"     : 1,
                  "on-click-right": "mode",
                  "format": {
                              "months":     "<span color='#ffead3'><b>{}</b></span>",
                              "days":       "<span color='#ecc6d9'><b>{}</b></span>",
                              "weeks":      "<span color='#99ffdd'><b>W{}</b></span>",
                              "weekdays":   "<span color='#ffcc66'><b>{}</b></span>",
                              "today":      "<span color='#ff6699'><b><u>{}</u></b></span>"
                              }
               }
        }

@LukashonakV
Copy link
Contributor

LukashonakV commented Jul 19, 2023

I reproduced the same issue in my machine. Need to take some time to clarify how your case should be look like. Now I suspect 3-rd party library is used by waybar calendar provides not correct result. Utility date shows me correct results.... so . Will reply once I've got a clear vision on the case

@LukashonakV
Copy link
Contributor

So... issue is found. But... needs to think now how to handle. It appears due to calendar for it's need uses date::sys_days typedef... which represents time point in UTC... Where there's another time point structure date::local_days which represents time point associated with timezone... I guess I'll provide new implementation.... Will notify once it's done.
Thank you

@randomn4me
Copy link

randomn4me commented Jan 11, 2024

Hi,

it seems I have a similiar issue. January started on Monday in 2024 here in Germany. My calendar (module waybar-clock tooltip) shows a week-number of 00 but it should be 01. Using the manual I found out about the timezone option, which did not help here, but is still added to the config.

My module config:

"clock": {
  "actions": {
    "on-click-right": "mode",
    "on-scroll-down": "shift_down",
    "on-scroll-up": "shift_up"
  },
  "calendar": {
    "format": {
      "days": "<span color='#A9B1D6'>{}</span>",
      "months": "<span color='#A9B1D6'><b>{}</b></span>",
      "today": "<span color='#F7768E'><b>{}</b></span>",
      "weekdays": "<span color='#9ECE6A'><b>{}</b></span>",
      "weeks": "<span color='#2AC3DE'><b>{}</b></span>"
    },
    "mode": "month",
    "mode-mon-col": 3,
    "on-scroll": 1,
    "weeks-pos": "left"
  },
  "format": "{:%d.%m %H:%M}",
  "interval": 1,
  "timezone": "Europe/Berlin",
  "tooltip-format": "<tt><small>{calendar}</small></tt>\n"
},

And the outputs asked for by @LukashonakV (with a newline between)

1. `date '+%c'`
2. `echo $LANG`
3. `waybar --version`
4. `uname -a`
~ >> date '+%c'
echo $LANG
waybar --version
uname -a

Do 11 Jan 2024 11:21:05 CET
en_US.UTF-8
Waybar v0.9.24
Linux work 6.7.0 #1-NixOS SMP PREEMPT_DYNAMIC Sun Jan  7 20:18:38 UTC 2024 x86_64 GNU/Linux

Cheers

@ckudera
Copy link

ckudera commented Jan 19, 2024

Update: Sorry, I missed the right configuration in the documentation.

@randomn4me It should be "weeks": "<span color='#2AC3DE'><b>{:%W}</b></span>"

See #2827

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

No branches or pull requests

5 participants