diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-18 13:29:38 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 18:48:24 +0200 |
commit | bc8b25dd91e931e892f478ea5ec8f0e3062655ff (patch) | |
tree | 738e8f3e6b86cab1eccee06839d439034c2a8a72 /src/qml/jsruntime/qv4dateobject.cpp | |
parent | 52cc10589a8b3df2876dc7d3855e67bc91ee0e82 (diff) |
Correctly convert an invalid QDateTime to JS
Task-number: QTBUG-33539
Change-Id: I645db2e12e3b46731c0bef04e2d48abb71650974
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 7707d188ee..76d712656a 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -641,7 +641,7 @@ DateObject::DateObject(ExecutionEngine *engine, const QDateTime &date) { vtbl = &static_vtbl; type = Type_DateObject; - value = Value::fromDouble(date.toMSecsSinceEpoch()); + value.setDouble(date.isValid() ? date.toMSecsSinceEpoch() : qSNaN()); } QDateTime DateObject::toQDateTime() const |