| Summary: | In Digital Clock 3.0 - Custom date format shows incorrect month - M01 instead of Jan | ||
|---|---|---|---|
| Product: | [Plasma] plasmashell | Reporter: | Bruce Ferry <bmferry> |
| Component: | Digital Clock widget | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | RESOLVED NOT A BUG | ||
| Severity: | normal | CC: | fabian, nate, plasma-bugs-null, rapiteanu.catalin, zrenfire |
| Priority: | NOR | ||
| Version First Reported In: | 5.23.5 | ||
| Target Milestone: | 1.0 | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Correctly displayed format.
Screenshot showing the config and what I see |
||
|
Description
Bruce Ferry
2022-01-22 23:21:25 UTC
dddd is Saturday not Sat dd is 22 MMM is Jan mmm is mmm since digitalclock uses Qt.formatDate() not Qt.formatDateTime() Which locale? ❯ locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" ... LC_ALL= ❯ date Sat Jan 22 08:37:36 PM EST 2022 Created attachment 145801 [details]
Correctly displayed format.
I tested this on the latest master branch and everything worked. Can someone retry this to see exactly how it works?
Created attachment 145810 [details]
Screenshot showing the config and what I see
Should have attached this before.
I'm in the eastern US time zone if that matters.
I do remember that this used to work correctly but I'm not sure when it changed. I don't normally have the widget installed but I see exactly the same thing on the task bar clock.
This can happen if "MMM" gets parsed as "M" followed by "MM", e.g. with an invisible character in between. It works fine here on Tumbleweed with en_US.UTF-8 locale and "ddd d-MMM" format. So the `locale` command shows LC_TIME="en_US.UTF-8"? And you're also in EST. Good to know. "M01" could be a legit "testing" locale for Jan. I've just never seen it before. OpenSUSE Tumbleweed right? What Qt version? I have Qt 5.15.2+kde268-2.1 Qt uses CLDR for their locale database. https://github.com/qt/qtbase/tree/dev/util/locale_database https://cldr.unicode.org/index/downloads https://unicode-org.github.io/cldr-staging/charts/40/ https://unicode-org.github.io/cldr-staging/charts/40/delta/en.html https://www.google.com/search?hl=en&q=site%3Ahttps%3A%2F%2Funicode%2Dorg.github.io%2Fcldr%2Dstaging%2Fcharts%2F40%2F%20%22M01%22 Looks like the Sardinian [sc] v40 Delta has M01. Not sure what "delta" is though. https://unicode-org.github.io/cldr-staging/charts/40/delta/sc.html There's also Fulah [ff] which has M01. https://unicode-org.github.io/cldr-staging/charts/40/summary/ff.html Chinese locales tend to have numbers in the month names like: 1月, 2月 for Jan, Feb. https://unicode-org.github.io/cldr-staging/charts/latest/verify/dates/zh.html > This can happen if "MMM" gets parsed as "M" followed by "MM", e.g. with an invisible character in between. Why would it output M=M instead of M=1? An invisible character would be equivalent to "M MM" which would be "1 01". You would need apostrophes to escape it like 'M'MM to get "M01". . "dddd dd-MMM" works for me with the en_US locale, FWIW. Problem solved. Locale showed 'LC_TIME="lv_US.UTF-8"'. Changing it to LC_TIME="en_US.UTF-8" resolved it. I have no idea how this might have gotten changed. Thanks to all who pitched in their two cents |