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

[BUG] Zero padding is disabled when offset is applied #1399

Open
4 tasks done
cobunr opened this issue Jan 6, 2025 · 1 comment
Open
4 tasks done

[BUG] Zero padding is disabled when offset is applied #1399

cobunr opened this issue Jan 6, 2025 · 1 comment
Assignees
Labels
bug Something isn't working ready-to-go Ready to be fixed without further conversation

Comments

@cobunr
Copy link

cobunr commented Jan 6, 2025

Please confirm these before moving forward

  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have tested that this issue has not been fixed in the latest (beta or stable) release.
  • I have checked the FAQ section for solutions.
  • This issue is about a bug (if it is not, please use the correct template).

Describe your issue

(Disclaimer: Due to closed office IT environment I cannot update to latest 4.4.1.1, currently running 4.2.2. I could not find any mention in the PRs of this being fixed.) Issue also present in 4.4.1.1

My custom date/time format is %y%W.%w, which today results in 2501.1
However in my locale it is customary to follow ISO 8601, so it should be week 2 as of today (Jan 6).

I tried to correct using an offset, but then I lose zero padding for the weeknumber.

So this issue is twofold:

  1. ElevenClock does not follow ISO 8601 I learnt that I can use %V, so the issue is actually the link to https://strftime.org/ instead of https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
  2. Using offset for week number disables zero padding

Steps to reproduce the issue

Apply offset with {%W+1}, this loses the zero padding you get using %W

ElevenClock Log

🟢 Using cached lang file
🟡 Using bundled lang file (forced=True)
It took 0.17370390892028809 to load all language files
---------------------------------------------------------------------------------------------------

   ElevenClock's 4.2.2 (v4.22) log: Select all the text and hit Ctrl+C to copy it
   All modules loaded successfully and sys.stdout patched correctly, starting main script
   Translator function set language to "en"

---------------------------------------------------------------------------------------------------

 Log legend:
 🔵: Verbose
 🟢: Information
 🟡: Warning
 🟠: Handled unexpected exception
 🔴: Unhandled unexpected exception
 🟣: Handled expected exception

🔵 Initializing clock 0...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(1720, 1034, 200, 46)
🔵 Full screen rect:  (0, 0, 1920, 1080)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🔵 Language file up-to-date
🟡 Custom loaded date time format (clock 0): %H:%M:%S\n%a %#d %b\n%y%W.%w
🔵 Restart loop: 1
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🔵 Initializing clock 1...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(-1061, 2114, 200, 46)
🔵 Full screen rect:  (-2781, 1080, -861, 2160)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🟡 Custom loaded date time format (clock 1): %H:%M:%S\n%a %#d %b\n%y%W.%w
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🔵 Initializing clock 2...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(-200, 1034, 200, 46)
🔵 Full screen rect:  (-1920, 0, 0, 1080)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🟡 Custom loaded date time format (clock 2): %H:%M:%S\n%a %#d %b\n%y%W.%w
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🟢 Loaded clocks in 3.489898681640625
🟡 restartClocks function has not been defined yet!
🟡 restartClocks function has not been defined yet!
🟡 restartClocks function has not been defined yet!
🟠 Update checking disabled
🔵 Low cpu mode is set to True. DisableNotifications is set to False
🟢 Loaded everything in 8.592529535293579
🔵 Initializing clock 0...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(1720, 1034, 200, 46)
🔵 Full screen rect:  (0, 0, 1920, 1080)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🟡 Custom loaded date time format (clock 0): %H:%M:%S\n%a %#d %b\n%y%W.%w
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🔵 Initializing clock 1...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(-1061, 2114, 200, 46)
🔵 Full screen rect:  (-2781, 1080, -861, 2160)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🟡 Custom loaded date time format (clock 1): %H:%M:%S\n%a %#d %b\n%y%W.%w
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🔵 Restart loop: 1
🔵 Initializing clock 2...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(-200, 1034, 200, 46)
🔵 Full screen rect:  (-1920, 0, 0, 1080)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🟡 Custom loaded date time format (clock 2): %H:%M:%S\n%a %#d %b\n%y%W.%w
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🟠 Update checking disabled
🔵 Showing tooltip
🔵 Long date string: dddd, MMMM d, yyyy
🔵 Showing tooltip
🔵 Long date string: dddd, MMMM d, yyyy
🔵 Announcement URL: https://www.marticliment.com/resources/elevenclock.announcement
🔵 Image URL: https://marticliment.com/resources/translate.png
🔴 Traceback (most recent call last):

🔴 Traceback (most recent call last):

🔴   File ".\settings.py", line 3100, in updateText

🔴   File ".\settings.py", line 3100, in updateText

🔴 ValueError: Invalid format string

🔴 ValueError: Invalid format string

🔴 Note this traceback was caught by reporter and has been added to the log (Invalid format string)
🔴 Traceback (most recent call last):

🔴 Traceback (most recent call last):

🔴   File ".\settings.py", line 3100, in updateText

🔴   File ".\settings.py", line 3100, in updateText

🔴 ValueError: Invalid format string

🔴 ValueError: Invalid format string

🔴 Note this traceback was caught by reporter and has been added to the log (Invalid format string)
🔴 Traceback (most recent call last):

🔴 Traceback (most recent call last):

🔴   File ".\settings.py", line 3100, in updateText

🔴   File ".\settings.py", line 3100, in updateText

🔴 ValueError: Invalid format string

🔴 ValueError: Invalid format string

🔴 Note this traceback was caught by reporter and has been added to the log (Invalid format string)
🔴 Traceback (most recent call last):

🔴 Traceback (most recent call last):

🔴   File ".\settings.py", line 3100, in updateText

🔴   File ".\settings.py", line 3100, in updateText

🔴 ValueError: Invalid format string

🔴 ValueError: Invalid format string

🔴 Note this traceback was caught by reporter and has been added to the log (Invalid format string)
🔴 Traceback (most recent call last):

🔴 Traceback (most recent call last):

🔴   File ".\settings.py", line 3100, in updateText

🔴   File ".\settings.py", line 3100, in updateText

🔴 ValueError: Invalid format string

🔴 ValueError: Invalid format string

🔴 Note this traceback was caught by reporter and has been added to the log (Invalid format string)
🟡 loadTimeFormat function has not been defined yet!
🔵 Initializing clock 0...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(1720, 1034, 200, 46)
🔵 Full screen rect:  (0, 0, 1920, 1080)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🟡 Custom loaded date time format (clock 0): %H:%M\n%a %#d %b\n%y{%W+1}.%w
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🔵 Initializing clock 1...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(-1061, 2114, 200, 46)
🔵 Full screen rect:  (-2781, 1080, -861, 2160)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🟡 Custom loaded date time format (clock 1): %H:%M\n%a %#d %b\n%y{%W+1}.%w
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🔵 Initializing clock 2...
🟡 Not using taskbar background color
🔵 Using bg color: 33,33,33,100.0
🟢 Regular sized taskbar
🟢 Clock on the bottom
🟢 Clock on the right
🔵 Clock geometry: PySide6.QtCore.QRect(-200, 1034, 200, 46)
🔵 Full screen rect:  (-1920, 0, 0, 1080)
🔵 Using automatic font color
🔵 Font families   : []
🔵 Custom font     : 72,9,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular
🔵 Font size: 9.0
🟡 Custom loaded date time format (clock 2): %H:%M\n%a %#d %b\n%y{%W+1}.%w
🔵 Show/hide loop started with parameters: HideonFS:True, NotHideOnTB:False, DisableNotifications:True
🔵 Restart loop: 1
🔵 Announcement URL: https://www.marticliment.com/resources/elevenclock.announcement
🔵 Image URL: https://marticliment.com/resources/translate.png
🔵 Showing tooltip
🔵 Long date string: dddd, MMMM d, yyyy
Action: ('win', 'n')
🔵 Showing tooltip
🔵 Long date string: dddd, MMMM d, yyyy
🔵 Showing tooltip
🔵 Long date string: dddd, MMMM d, yyyy
Action: ('win', 'n')
🔵 Copying log to the clipboard...

Relevant information

No response

Screenshots and videos

image

image

@cobunr cobunr added bug Something isn't working triage This hasn't been chcked yet by any maintainer labels Jan 6, 2025
@marticliment
Copy link
Owner

I will investigate

@marticliment marticliment added ready-to-go Ready to be fixed without further conversation triage This hasn't been chcked yet by any maintainer and removed triage This hasn't been chcked yet by any maintainer labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-to-go Ready to be fixed without further conversation
Projects
None yet
Development

No branches or pull requests

2 participants