diff --git a/src/corelib/text/qlocale_mac.mm b/src/corelib/text/qlocale_mac.mm index 0e69b8135f7..e665b3a2f23 100644 --- a/src/corelib/text/qlocale_mac.mm +++ b/src/corelib/text/qlocale_mac.mm @@ -344,7 +344,10 @@ static QVariant macToQtFormat(QStringView sys_fmt) case 'Y': // Year for Week-of-year calendars (1..n): 1..n = padded number break; - case 'u': // Extended Year (1..n): 2 = short year, 1 & 3..n = padded number + case 'u': // Extended Year (1..n), padded number. + // Explicitly has no special case for 'uu' as only the last two digits. + result += "yyyy"_L1; + break; case 'y': // Year (1..n): 2 = short year, 1 & 3..n = padded number // Qt only supports long (4) or short (2) year, use long for all others if (repeat == 2) diff --git a/util/locale_database/dateconverter.py b/util/locale_database/dateconverter.py index efe028ccf56..5e750b76da8 100644 --- a/util/locale_database/dateconverter.py +++ b/util/locale_database/dateconverter.py @@ -100,6 +100,13 @@ class Converter (object): n = cls.__count_first(text) return ('z' if n < 3 else 'zzz'), n + @classmethod + def u(cls, text): # Extended year (numeric) + # Officially, 'u' is simply the full year number, zero-padded + # to the length of the field. Qt's closest to that is four-digit. + # It explicitly has no special case for two-digit year. + return 'yyyy', cls.__count_first(text) + # U: Cyclic Year Name. Not supported @classmethod def v(cls, text): # Generic non-location format. Map to abbreviation.