Bug 370306 - no option to show 12-hour time without displaying the AM/PM part
Summary: no option to show 12-hour time without displaying the AM/PM part
Status: RESOLVED INTENTIONAL
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock widget (show other bugs)
Version: 5.8.0
Platform: unspecified Linux
: NOR wishlist
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-08 16:30 UTC by Aaron Wolf
Modified: 2025-02-26 12:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Wolf 2016-10-08 16:30:47 UTC
because the space used by Digital Clock is relevant to the font-size and the fit in various contexts, the ability to hide the AM/PM part of 12-hour time is valuable. Of course, anyone viewing local time knows whether it is morning or evening already without the AM/PM part, so it really isn't necessary.

Reproducible: Always

Steps to Reproduce:
1. Uncheck 24-hour time
2. Notice that the 12-hour time always shows the AM/PM part and no option is available to hide that



Here is a modification that successfully hides the AM/PM part:

In `/usr/share/plasma/plasmoids/org.kde.plasma.digitalclock/contents/ui/DigitalClock.qml`,
replace
`return Qt.formatTime(currentTime, main.timeFormat);`
with
`return Qt.formatTime(currentTime, 'h:mm ap').replace(' am', '').replace(' pm', '');`

The only trouble is that the time can now be large enough to bump into the date when that is shown. Some additional modification should be added to ensure some small margin between the date and time.
Comment 1 Kai Uwe Broulik 2016-10-08 16:34:37 UTC
I don't think the already complex and broken logic in the digital clock should be complicated further. Your patch also won't work for other languages as it's not necessarily "am" / "pm" and we would need a configurable option for that.
Comment 2 Aaron Wolf 2016-10-08 18:15:25 UTC
So, what's the actual solution? I wasn't suggesting my patch as the solution necessarily. I was wanting the problem addressed and just mentioned something that could possibly work. I don't care about my solution being accepted, but I want the issue resolved.

Without removing the AM/PM part of 12-hour time, I can't have a readably large time in 12-hour numbers in a panel that is on the left or right side of the screen!
Comment 3 Aaron Wolf 2016-10-08 18:17:56 UTC
To be clear: I'm asking for this to remain open and be just a request for a checkbox for whether or not to show the AM/PM part of the time. This makes the difference between a usable or unusable digital clock for left or right side panels.