diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2024-04-03 19:13:23 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2024-04-19 13:39:41 +0200 |
commit | b87db4296cb5d41a9915f04cc7638f975836c046 (patch) | |
tree | 228839bc9f3bd19c7457f7085c23ab2f5cf452a0 /src/corelib | |
parent | 42e4e1816ab6822eb431d8e16d9979bd72a19fdf (diff) |
Correct handling of 'u' in CLDR date format strings
It explicitly excludes having a two-digit special case like 'yy'.
Correct that in qlocale_mac.mm, add support in dateconverter.py
No current locale actually uses the 'u' format, so this makes no
change to data.
Change-Id: I16dfed2d3a7d2054b4b86f9a246bff297df9fc0a
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/text/qlocale_mac.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/text/qlocale_mac.mm b/src/corelib/text/qlocale_mac.mm index 0e69b8135f..e665b3a2f2 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) |