aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/assignDate.4.qml
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-04-13 16:12:55 +1000
committerQt by Nokia <qt-info@nokia.com>2012-04-24 00:33:00 +0200
commita8e017fbc22d8ec445fc9202479a775bdac4d5b0 (patch)
tree6980d3a6815ecd75b4ab92d978adaf29252c2ad6 /tests/auto/qml/qqmlecmascript/data/assignDate.4.qml
parenta36f220e1554c15c4a5808479a4af90b39075e6a (diff)
Record current status of date conversion from QML
Ensure that the qqmlecmascript test is not broken by changes in the time zone of the test environment. This test documents the existing situation with convertibility of date information between QML and JS. Task-number: QTBUG-25262 Change-Id: I42716e0b34ef26daa391fdb4aebc1f31340fcea0 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/assignDate.4.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/assignDate.4.qml34
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/assignDate.4.qml b/tests/auto/qml/qqmlecmascript/data/assignDate.4.qml
index 16213c691f..9b4975c833 100644
--- a/tests/auto/qml/qqmlecmascript/data/assignDate.4.qml
+++ b/tests/auto/qml/qqmlecmascript/data/assignDate.4.qml
@@ -1,6 +1,36 @@
import Qt.test 1.0
+import QtQuick 2.0
MyTypeObject {
- dateProperty: if(1) new Date("1982-11-25Z")
- dateTimeProperty: if(1) new Date("2009-05-12T13:22:01Z")
+ dateProperty: if (1) new Date("2009-05-12Z")
+ dateTimeProperty: if (1) new Date("2009-05-12T00:00:01Z")
+ dateTimeProperty2: if (1) new Date("2009-05-12T23:59:59Z")
+
+ boolProperty: false
+ Component.onCompleted: {
+ var dateVar = new Date("2009-05-12Z")
+ var dateTimeVar = new Date("2009-05-12T00:00:01Z")
+ var dateTimeVar2 = new Date("2009-05-12T23:59:59Z")
+
+ // Commented properties do not currently test true:
+ boolProperty = //(dateProperty.getTime() == dateVar.getTime()) &&
+ (dateProperty.getFullYear() == 2009) &&
+ (dateProperty.getMonth() == 5-1) &&
+ //(dateProperty.getDate() == 12) &&
+ (dateProperty.getHours() == 0) &&
+ (dateTimeProperty.getTime() == dateTimeVar.getTime()) &&
+ (dateTimeProperty.getFullYear() == 2009) &&
+ (dateTimeProperty.getMonth() == 5-1) &&
+ //(dateTimeProperty.getDate() == 12) &&
+ //(dateTimeProperty.getHours() == 0) &&
+ (dateTimeProperty.getMinutes() == 0) &&
+ (dateTimeProperty.getSeconds() == 1) &&
+ (dateTimeProperty2.getTime() == dateTimeVar2.getTime()) &&
+ (dateTimeProperty2.getFullYear() == 2009) &&
+ (dateTimeProperty2.getMonth() == 5-1) &&
+ //(dateTimeProperty2.getDate() == 12) &&
+ //(dateTimeProperty2.getHours() == 23) &&
+ (dateTimeProperty2.getMinutes() == 59) &&
+ (dateTimeProperty2.getSeconds() == 59)
+ }
}