aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlstringconverters.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-24 11:59:08 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-25 09:40:00 +0200
commit5c672954e391d43e1fb94e6d76aaedc987dea468 (patch)
tree9fc726428c822ff29d2214f4e270738204aecfbf /src/qml/qml/qqmlstringconverters.cpp
parentf25e4c60f6ff2c200d2bf1c94d0dafa966c5c98f (diff)
Drop special casing of QDateTime when setting values
This introduced inconsistency in order to be compatible with V8 and Qt 5.0/5.1, respectively. We don't need to do this anymore. We standardize on the behavior observed when statically setting a property in QML, e.g. "foo: '2014-03-03'", rather than the behavior observed when dynamically setting it from JavaScript. [ChangeLog][Important Behavior Changes] Dates are interpreted the same way when assigned to QML properties as when parsed in JavaScript now. The time zone is generally left alone, not forced to UTC in some cases. Fixes: QTBUG-36635 Change-Id: I72a7045d7b39ee1c6e0ac1ef55d74ef8aa505f00 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlstringconverters.cpp')
-rw-r--r--src/qml/qml/qqmlstringconverters.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlstringconverters.cpp b/src/qml/qml/qqmlstringconverters.cpp
index d1c7d8cdf3..ba52519eb0 100644
--- a/src/qml/qml/qqmlstringconverters.cpp
+++ b/src/qml/qml/qqmlstringconverters.cpp
@@ -125,9 +125,6 @@ QDateTime QQmlStringConverters::dateTimeFromString(const QString &s, bool *ok)
{
QDateTime d = QDateTime::fromString(s, Qt::ISODate);
if (ok) *ok = d.isValid();
- // V8 never parses a date string as local time. For consistency do the same here.
- if (d.timeSpec() == Qt::LocalTime)
- d.setTimeSpec(Qt::UTC);
return d;
}
#endif // datestring