qt6-bb10/tests/auto/corelib
Edward Welbourne 41f84f3ddb Give the caller control over the century used for two-digit dates
The twentieth century is now some way behind us, so using its years
when parsing a date-time format that only provides the last two digits
is increasingly likely to produce unwelcome results. Most such formats
are saved by the "redundant" presence of a day-of-week field but, for
those that are not (notably including ASN.1 date fields), there is a
need to provide some way to over-ride the twentieth century default.

Allow the caller to pass a base year to the fromString() methods, of
QDate and QDateTime, and to QLocale's toDate() and toDateTime(), that
indicates the first of 100 consecutive years, among which the two
digits given can select a year. Add some test-cases to exercise the
new API.

[ChangeLog][QtCore][QDate] When fromString() has only a two-digit year
to go on, it is now possible to set the start-year of the century
within which this selects.

[ChangeLog][QtCore][QDateTime] When fromString() has only a two-digit
year to go on, it is now possible to set the start-year of the century
within which this selects.

[ChangeLog][QtCore][QLocale] When toDate() or toDateTime() has only a
two-digit year to go on, it is now possible to set the start-year of
the century within which this selects.

Fixes: QTBUG-46843
Change-Id: Ieb312ee9e0b80557a15edcb0e6d75a57b10d7a62
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-08 11:40:36 +01:00
..
animation Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
global Add missing <=> 0 operator to Qt ordering types 2023-12-07 23:36:15 +01:00
io Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
ipc QSharedMemory: fix attach() -> create() for non-legacy SystemV mode 2023-11-08 15:56:54 +01:00
itemmodels Q(Persistent)ModelIndex: use new test framework for op== 2023-11-13 17:35:54 +02:00
kernel QMetaEnum: let key(s)ToValue match fully-qualified unscoped enumerators 2023-11-26 22:51:49 +02:00
mimetypes Long live QSpan as public API! 2023-12-07 22:38:15 +00:00
platform Android: fix and simplify the orientation change logic 2023-12-05 16:28:12 +00:00
plugin QFactoryLoader: add metaDataKeys() to return just the "Keys" entry 2023-11-28 03:14:03 -08:00
serialization Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
text tst_QString: explain TransientDefaultLocale better 2023-12-07 23:55:08 +01:00
thread Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
time Give the caller control over the century used for two-digit dates 2023-12-08 11:40:36 +01:00
tools Make QAtomicScopedValueRollback public API 2023-12-08 02:24:41 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00