marcinjakubowski / date-menu-formatter

Date Menu Formatter GNOME Shell extension
GNU General Public License v2.0
34 stars 15 forks source link

Week of year shows 0 #33

Closed theniwo closed 1 month ago

theniwo commented 6 months ago

My string is EEE, MMM.d.y - 'KW:' ww - kk:mm:ss and it shows image

No change if I only put a single w

When I put W I get ?

I am expecting w and ww to render as 1 and 01 for the first week in europe.

shane-ns1 commented 6 months ago

Depending on what standard is used for week number, 0 is sometimes acceptable. From the GNU date man page:

       %U     week number of year, with Sunday as first day of week (00..53)

       %V     ISO week number, with Monday as first day of week (01..53)

...

       %W     week number of year, with Monday as first day of week (00..53)
rhuijts commented 6 months ago

The list of Available pattern components does not include U or V (they render blank and undefined respectively). The listed w (week of year) and W (week of month) components do not correspond with the GNU date format sequences %w (day of week) and %W (week number of year). I guess that this extensions maps the w component to the %W sequence. However, the extension shows a link to a Full list (web) which instructs to use the w symbol to get the ISO 8601 week number, in conjunction with the Y symbol for the corresponding year, that may differ from calendar year ‘y’ near a year transition. The ISO 8601 week number is never zero.

I have tried changing the used locale, but it had no effect on the week number. So how can I make this extension display the ISO 8601 week number? That is what we use in the Netherlands, and most of Europe, Asia and Oceania.

Sitethief commented 5 months ago

I have the same problem, it should display week 5 today, but it shows week 4, and I can't get it to show anything but 4 or ?, messing with the system locale changes nothing.

lbrcs commented 2 months ago

Having the same issue since the beginning of the year - has anyone found a workaround for this by now? @marcinjakubowski Any plans on looking into this? :)

JCTechSol commented 2 months ago

I too am looking for this to be displayed using ISO 8601 Week Numbering

rhuijts commented 2 months ago

I saw that @bomdia did some great work on the formatter, but it appears I am running an older version of the extension that does not yet include the "added support for advanced formatters". I am running Ubuntu 22.04 with Gnome version 42.9 and I have used the gnome-shell-extension-manager to install the Date Menu Formatter extension, which seems to be stuck on version 10 because of the old Gnome version. Other than waiting for the release of Ubuntu 24.04, I have no workaround yet.

rhuijts commented 2 months ago

Okay I did find a workaround, by switching over to the "Panel Date Format" which uses a subset of the strftime() format language, including %V for the ISO 8601 week number. It works on Gnome shell versions up to 44 but not 45 yet, so I promise I will be back to this extension as soon as I can :wink:

Maybe the others in this thread can also check which version of the extension and Gnome they are running, to help determine whether the issue still exists. I was able to see the extension version in the extension manager.

JCTechSol commented 2 months ago

I'm running gnome 44.1 with extension 10. vV only shows up as "undefined" @rhuijts not sure what you mean by switching over to the Panel Date Format

JCTechSol commented 1 month ago

It's working correctly under Gnome shell 45 using the "Luxon" formatter. (This was not available in Gnome 44)

theniwo commented 1 month ago

Yes, with Gnome 45 it works.