summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetimeparser_p.h
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2016-12-15 10:57:17 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2017-06-20 09:54:07 +0000
commit68f19fb630dc02463c2d61fc511de7407687795e (patch)
treee060d222527b39cd4766c973aacc580e06fe7c2d /src/corelib/tools/qdatetimeparser_p.h
parent02b7ec05d5713aec67577cebc18e5906b5a98598 (diff)
QDateTimeParser: implement parsing of time-zone specifiers
The serialization of date-times understood time-zones (indicated by a 't' in a format string) but the parsing didn't (so viewed the 't' as a literal element in the format string, not matched by the actual zone it needs to parse), although some tests expected it to. This made round-trip testing fail. Implemented parsing of time-zones. Re-enabled the formerly failing tests. [ChangeLog][QtCore][QDateTime] Added support for parsing of time-zones. Task-number: QTBUG-22833 Change-Id: Iddba7dca14cf9399587078d4cea19f9b95a65cf7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qdatetimeparser_p.h')
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index 1efc6696ce..25afd3a2ad 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -113,9 +113,10 @@ public:
MinuteSection = 0x00008,
Hour12Section = 0x00010,
Hour24Section = 0x00020,
+ TimeZoneSection = 0x00040,
HourSectionMask = (Hour12Section | Hour24Section),
TimeSectionMask = (MSecSection | SecondSection | MinuteSection |
- HourSectionMask | AmPmSection),
+ HourSectionMask | AmPmSection | TimeZoneSection),
DaySection = 0x00100,
MonthSection = 0x00200,
@@ -218,6 +219,8 @@ private:
PossibleBoth = 4
};
AmPmFinder findAmPm(QString &str, int index, int *used = 0) const;
+ int findTimeZone(QStringRef str, const QDateTime&when, int *used) const;
+ static int startsWithLocalTimeZone(const QStringRef name); // implemented in qdatetime.cpp
bool potentialValue(const QStringRef &str, int min, int max, int index,
const QDateTime &currentValue, int insert) const;
bool potentialValue(const QString &str, int min, int max, int index,