Bug 452888

Summary: 24-hour config setting does not propagate to items in the "Copy to clipboard" menu
Product: [Plasma] plasmashell Reporter: local10
Component: Digital ClockAssignee: Plasma Bugs List <plasma-bugs>
Status: REOPENED ---    
Severity: normal CC: nate
Priority: NOR    
Version: 5.26.3   
Target Milestone: 1.0   
Platform: Debian testing   
OS: Other   
Latest Commit: Version Fixed In: 5.26
Attachments: KDE Digital Clock widget 24-hour issue
Regional system settings
KDE 5.25.3. Digital Clock "Copy to clipboard" > submenu inconsistencies
KDE 5.26.4 Digital clock copy menu appearance

Description local10 2022-04-23 04:11:49 UTC
SUMMARY
Digital Clock widget partially fails to adhere to the 24-hour config setting. Even if the 24-hour config setting is selected the Digital Clock widget still show time in the AM/PM format when doing "RMB click on the widget > Copy to the clipboard"

STEPS TO REPRODUCE
1. Place the Digital Clock widget on the task bar
2. Open the Digital Clock widget settings and select "Time display"=24 hours
3. The Digital Clock widget will show the time in 24-hour format on the task bar but when doing doing "RMB click on the widget > Copy to the clipboard" the time is still shown in the AM/PM format.

OBSERVED RESULT
The Digital Clock widget will show the time in 24-hour format on the task bar but when doing doing "RMB click on the widget > Copy to the clipboard" the time is still shown in the AM/PM format.

EXPECTED RESULT
When doing doing "RMB click on the Digital Clock widget > Copy to the clipboard" the time should be shown in the 24-hour format.

Operating System: Debian 12 Bookworm GNU/Linux
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.16.0-6-amd64 (64-bit)
Graphics Platform: X11
Comment 1 local10 2022-04-25 05:07:50 UTC
More info:

$ locale
LANG=osa_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
Comment 2 Nate Graham 2022-04-25 17:03:20 UTC
Can you attach a screenshot so I can see which exact menu item you're talking about? There are quite a few in that menu.
Comment 3 local10 2022-04-25 19:23:26 UTC
The menu item is called "Copy to Clipboard" and it's the very first item in the popup menu that appears when you do a RMB click on the Digital Clock widget. You can't miss it.

Attaching a screenshot is difficult as the popup menu disappears when I switch focus to a screenshot taking app, Spectacle in my case. Let me know if you absolutely can't find it without a screenshot, I'll see what can be done.
Comment 4 Nate Graham 2022-04-26 14:09:51 UTC
Yes, but which entry in the "copy to clipboard" menu specifically?

On X11, you can take a screenshot of a menu by using Spectacle's delay functionality. Set a 3 second delay, then make the menu appear.
Comment 5 local10 2022-04-26 21:12:19 UTC
Created attachment 148397 [details]
KDE Digital Clock widget 24-hour issue

OK, here's an enclosed screenshot that illustrates the issue, where

1. The vertical task bar with the Digital Clock widget on top.
2. Digital Clock widget showing 16:51 time
3. "Copy to Clipboard" menu item, you get the menu but doing a RMB click on the Digital Clock wizard (2)
4. Another popup menu that shows the problem, the time is now shown as 4:51 PM instead of 16:51 as it should've been according to the 24-hour config setting.
Comment 6 Nate Graham 2022-04-27 16:43:09 UTC
Got it, thanks. Can confirm.
Comment 7 Felipe Kinoshita 2022-05-10 16:48:48 UTC
Git commit 9dad186438311dd1ed32a4acfe10c01d7168ecb1 by Felipe Kinoshita.
Committed on 10/05/2022 at 01:19.
Pushed by fhek into branch 'master'.

applets/digital-clock: Make "Copy to Clipboard" menu follow system locale

This means that if your locale uses the 24 hour format the items
in that menu will use that format as well and vice-versa.

M  +6    -6    applets/digital-clock/plugin/clipboardmenu.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/9dad186438311dd1ed32a4acfe10c01d7168ecb1
Comment 8 local10 2022-08-01 04:48:07 UTC
Same issue in:

Operating System: Debian 12 Bookworm GNU/Linux
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
Kernel Version: 5.18.0-2-amd64 (64-bit)
Graphics Platform: X11
Comment 9 local10 2022-08-01 04:50:32 UTC
Created attachment 151037 [details]
Regional system settings

Regional system settings
Comment 10 local10 2022-08-01 04:52:00 UTC
Created attachment 151038 [details]
KDE 5.25.3. Digital Clock "Copy to clipboard" > submenu inconsistencies

KDE 5.25.3. Digital Clock "Copy to clipboard" > submenu inconsistencies
Comment 11 Nate Graham 2022-08-01 15:15:11 UTC
The "Version fixed in" field was wrong; it's fully fixed only in Plasma 5.26, which hasn't been released yet.
Comment 12 Nate Graham 2022-08-01 15:15:33 UTC
Looks like it was supposed to be backported to 5.25, but this was forgotten. I'll do that real fast.
Comment 13 local10 2022-09-25 06:04:12 UTC
(In reply to Nate Graham from comment #12)
> Looks like it was supposed to be backported to 5.25, but this was forgotten.
> I'll do that real fast.

Looks like it still hasn't been ported to 5.25, the issue is still there:

Operating System: Debian 12 Bookworm GNU/Linux
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.4
Kernel Version: 5.19.0-1-amd64 (64-bit)
Graphics Platform: X11
Comment 14 Nate Graham 2022-09-26 16:37:52 UTC
This bug is marked as fixed in 5.26; you're using 5.25.5.

Unfortunately a backport was too to make it inth the final 5.25 release so it didn't get done. The Debian packagers will patch to manually patch it if they want this fix included.
Comment 15 local10 2022-10-29 04:14:04 UTC
I'm on 5.26 now and the bug still hasn't been fixed.

Operating System: Debian 12 Bookworm GNU/Linux
KDE Plasma Version: 5.26.0  KDE Frameworks Version: 5.98.0  Qt Version: 5.15.6
Kernel Version: 6.0.0-2-amd64 (64-bit)
Graphics Platform: X11
Comment 16 local10 2022-11-26 12:51:00 UTC
The issue is still present in:

Operating System: Debian 12 Bookworm GNU/Linux
KDE Plasma Version: 5.26.3  KDE Frameworks Version: 5.100.0  Qt Version: 5.15.6
Kernel Version: 6.0.0-4-amd64 (64-bit)
Graphics Platform: X11
Comment 17 local10 2022-12-05 14:30:30 UTC
Created attachment 154332 [details]
KDE 5.26.4 Digital clock copy menu appearance

This is how the Digital clock copy submenu looks for me in 5.26.4. Actually this is exactly how I want it except for the "AM" and "AM EST" indicators, these I don't want to see as I am using the 24-hour clock setting.

Operating System: Debian 12 Bookworm GNU/Linux
KDE Plasma Version: 5.26.4  KDE Frameworks Version: 5.100.0  Qt Version: 5.15.6
Kernel Version: 6.0.0-5-amd64 (64-bit)
Graphics Platform: X11