SUMMARY *** I've set a custom format in the widget - 'dddd dd-MMM'. It should show 'Sat 22-Jan' but shows 'Sat 22-M01' instead. *** STEPS TO REPRODUCE 1. Add a widget 2. Configure date format 'dddd dd-MMM' 3. Apply and observe the date shown OBSERVED RESULT See summary EXPECTED RESULT See summary SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: 5.23.5-1.1 (available in About System) KDE Plasma Version: 5.23.5-1.1 KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
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