diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2020-11-25 12:18:49 +0100 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-11-27 13:26:53 +0100 |
| commit | 3a4115d1236bc78dda078657883283cc92df8e8a (patch) | |
| tree | 8585f482de896841470dbb96c5ba506f0880c755 /src/gui/doc/snippets/plaintextlayout | |
| parent | cdcfb7c4f905fd75887d9f7aa5646dd91edde3ab (diff) | |
Return a more useful date-time on parser failure in spring-forward gap
Up to 5.15.0, QDateTime::fromString(), when parsing a string that
matched the format but represented a date-time in a spring-forward's
gap, would return an invalid date-time object that represented a "best
shot" date-time, correcting the error in the string as best it could.
In 5.15, in order to handle time-spec information correctly, we
adapted the date-time parser to have a fromString() variant that
parsed a date-time as a whole, rather than as a date and a time; as a
result, QDTP::fromString() now returns false and QDT::fromString()
returned a default-constructed instance instead of the invalid
date-time that QDTP had produced.
Amend 76054516047d8efb8529443830bb4d9ddf01010f to restore the prior
behavior of returning the invalid date-time object from QDTP instead
of a default-constructed invalid date-time. Also document what this
implies for the caller's ability to recover from the situation, if a
best shot result is better than nothing.
[ChangeLog][QtCore][QDateTime] Restored pre-5.15.0 behavior when
parsing a date-time from a string (and document what it implies): if
the string has the right form but represents a date-time that was
skipped by a time-zone transition (e.g. a DST spring-forward), the
invalid date-time object returned can, none the less, be used to
recover a near-by date-time that may be more useful in some cases.
From 5.15.0 to 5.15.2 and in 6.0.0, a default-constructed QDateTime
was returned in place of this more informative invalid date-time.
Task-number: QTBUG-88633
Pick-to: 6.0 5.15
Change-Id: If0b439038d5fe48eefb951c62f3aae2933bb5651
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/doc/snippets/plaintextlayout')
0 files changed, 0 insertions, 0 deletions
