diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-10-29 11:21:48 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-10-29 13:11:03 +0100 |
commit | 43eaa77e8ed03153335c0002dcc8b660c39a0beb (patch) | |
tree | 10bdc01a0c74323bf5ac497465d891b6da55d8e1 /src/qml/jsruntime/qv4dateobject.cpp | |
parent | d37448168930b3332890c6008367cafa74253c52 (diff) |
QML: Make date parsing more lenient
This fixes a regression from Qt 5 to Qt 6, because QDateTime is now
apparently more strict in its parsing of RFC2822Date. The string in the
test-case is not valid according to that spec, but JS engines like V8
still accept it, and so did we in Qt 5.
Fixes: QTBUG-87610
Change-Id: I2c6eb2087e4845b04fa0dc4f7aa9a229b3428a43
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 447f5b9661..19ae62f054 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -631,6 +631,8 @@ static inline double ParseString(const QString &s, double localTZA) QStringLiteral("d MMMM, yyyy"), QStringLiteral("d MMMM, yyyy hh:mm"), QStringLiteral("d MMMM, yyyy hh:mm:ss"), + + QStringLiteral("yyyy-MM-dd hh:mm:ss t"), }; for (const QString &format : formats) { |