summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Adams <chris.adams@qinetic.com.au>2020-10-16 14:03:59 +1000
committerChris Adams <chris.adams@qinetic.com.au>2020-11-02 13:19:31 +1000
commite38c85ba5c7f4ba1189dc1df0592b53e5e025da4 (patch)
tree126bbd3e444623d0cc2f11cbfe6b26f04eb83732
parent0d7a97f0717cef8a16cdba6b37de860a531f9407 (diff)
Work around JS Date constructor limitation in Qt6
See QTBUG-87610 Change-Id: Ib5ee1199c46f2c92cd736f14b58b53f587d1813b Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
-rw-r--r--tests/auto/organizer/qmlorganizer/testcases/MegaEvent.qml12
-rw-r--r--tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml2
-rw-r--r--tests/auto/organizer/qmlorganizer/testcases/tst_organizeritem.qml20
-rw-r--r--tests/auto/organizer/qmlorganizer/testcases/tst_organizeritemdetail.qml16
4 files changed, 25 insertions, 25 deletions
diff --git a/tests/auto/organizer/qmlorganizer/testcases/MegaEvent.qml b/tests/auto/organizer/qmlorganizer/testcases/MegaEvent.qml
index 06254cdd6..9fd8a92c4 100644
--- a/tests/auto/organizer/qmlorganizer/testcases/MegaEvent.qml
+++ b/tests/auto/organizer/qmlorganizer/testcases/MegaEvent.qml
@@ -30,8 +30,8 @@ import QtOrganizer 5.0
Event {
- startDateTime: new Date("2012-01-01 12:00:00 GMT+0000")
- endDateTime: new Date("2012-01-01 13:00:00 GMT+0000")
+ startDateTime: new Date("2012-01-01T12:00:00Z")
+ endDateTime: new Date("2012-01-01T13:00:00Z")
allDay: false
Comment {
@@ -61,8 +61,8 @@ Event {
}
Timestamp {
- created: new Date("2012-01-01 12:00:00 GMT+0000")
- lastModified: new Date("2012-01-01 12:00:00 GMT+0000")
+ created: new Date("2012-01-01T12:00:00Z")
+ lastModified: new Date("2012-01-01T12:00:00Z")
}
AudibleReminder {
@@ -121,8 +121,8 @@ Event {
EventRsvp {
organizerName: "Organizer name"
organizerEmail: "Organizer email"
- responseDate: new Date("2012-01-01 12:00:00 GMT+0000")
- responseDeadline: new Date("2012-01-01 12:00:00 GMT+0000")
+ responseDate: new Date("2012-01-01T12:00:00Z")
+ responseDeadline: new Date("2012-01-01T12:00:00Z")
participationStatus: EventAttendee.StatusAccepted
participationRole: EventAttendee.RoleOrganizer
responseRequirement: EventRsvp.ResponseRequired
diff --git a/tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml b/tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml
index 6c7eea84c..68d1cb4df 100644
--- a/tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml
+++ b/tests/auto/organizer/qmlorganizer/testcases/tst_organizer_versit_export_import_e2e.qml
@@ -69,7 +69,7 @@ TestCase {
Event {
id: testEvent
startDateTime: new Date("1991-08-25T20:57:08Z")
- endDateTime: new Date("1995-05-20 11:22:33 GMT+0200")
+ endDateTime: new Date("1995-05-20T11:22:33+0200")
displayLabel: "Versit event test"
}
diff --git a/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritem.qml b/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritem.qml
index c3fd0c0ad..a61c756a6 100644
--- a/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritem.qml
+++ b/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritem.qml
@@ -121,11 +121,11 @@ TestCase {
todoOccurrence.startDateTime = startDateTime
compare(todoOccurrence.startDateTime, startDateTime)
- var dueDateTime = new Date("2008-12-28 15:22:33 GMT+0300")
+ var dueDateTime = new Date("2008-12-28T15:22:33+0300")
todoOccurrence.dueDateTime = dueDateTime
compare(todoOccurrence.dueDateTime, dueDateTime)
- var finishedDateTime = new Date("1995-05-20 11:22:33 GMT+0200")
+ var finishedDateTime = new Date("1995-05-20T11:22:33+0200")
todoOccurrence.finishedDateTime = finishedDateTime
compare(todoOccurrence.finishedDateTime, finishedDateTime)
@@ -148,15 +148,15 @@ TestCase {
todo.percentageComplete = 64
compare(todo.percentageComplete, 64)
- var startDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
+ var startDateTime = new Date("1991-08-25T20:57:08Z")
todo.startDateTime = startDateTime
compare(todo.startDateTime, startDateTime)
- var dueDateTime = new Date("2008-12-28 15:22:33 GMT+0300")
+ var dueDateTime = new Date("2008-12-28T15:22:33+0300")
todo.dueDateTime = dueDateTime
compare(todo.dueDateTime, dueDateTime)
- var finishedDateTime = new Date("1995-05-20 11:22:33 GMT+0200")
+ var finishedDateTime = new Date("1995-05-20T11:22:33+0200")
todo.finishedDateTime = finishedDateTime
compare(todo.finishedDateTime, finishedDateTime)
@@ -183,7 +183,7 @@ TestCase {
function test_journal() {
compare(journal.itemType, Type.Journal)
- var dateTime = new Date("1991-08-25 20:57:08 GMT+0000")
+ var dateTime = new Date("1991-08-25T20:57:08Z")
journal.dateTime = dateTime
compare(journal.dateTime, dateTime)
}
@@ -217,13 +217,13 @@ TestCase {
compare(eventOccurrence.originalDate, utility.toUTCMidnight(originalDate))
compare(itemChangedSpy.count, ++count)
- var startDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
+ var startDateTime = new Date("1991-08-25T20:57:08Z")
eventOccurrence.startDateTime = startDateTime
itemChangedSpy.wait(waitTime);
compare(eventOccurrence.startDateTime, startDateTime)
compare(itemChangedSpy.count, ++count)
- var endDateTime = new Date("1995-05-20 11:22:33 GMT+0200")
+ var endDateTime = new Date("1995-05-20T11:22:33+0200")
eventOccurrence.endDateTime = endDateTime
itemChangedSpy.wait(waitTime);
compare(eventOccurrence.endDateTime, endDateTime)
@@ -254,13 +254,13 @@ TestCase {
//Following format does not work: GMT+0000 is not accepted by javascript
//event.startDateTime = "1991-08-25 20:57:08 GMT+0000"
- var startDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
+ var startDateTime = new Date("1991-08-25T20:57:08Z")
event.startDateTime = startDateTime
itemChangedSpy.wait(waitTime);
compare(event.startDateTime, startDateTime)
compare(itemChangedSpy.count, ++count)
- var endDateTime = new Date("1995-05-20 11:22:33 GMT+0200")
+ var endDateTime = new Date("1995-05-20T11:22:33+0200")
event.endDateTime = endDateTime
itemChangedSpy.wait(waitTime);
compare(event.endDateTime, endDateTime)
diff --git a/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritemdetail.qml b/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritemdetail.qml
index 83550dd9b..de8f66614 100644
--- a/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritemdetail.qml
+++ b/tests/auto/organizer/qmlorganizer/testcases/tst_organizeritemdetail.qml
@@ -371,13 +371,13 @@ TestCase {
compare(todoTime.value(TodoTime.FieldAllDay), true)
compare(todoTime.value(TodoTime.FieldStartDateTime), undefined)
- var startDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
+ var startDateTime = new Date("1991-08-25T20:57:08Z")
todoTime.startDateTime = startDateTime
compare(todoTime.startDateTime, startDateTime)
compare(todoTime.value(TodoTime.FieldStartDateTime), startDateTime)
compare(todoTime.value(TodoTime.FieldDueDateTime), undefined)
- var dueDateTime = new Date("1995-05-20 11:22:33 GMT+0200")
+ var dueDateTime = new Date("1995-05-20T11:22:33+0200")
todoTime.dueDateTime = dueDateTime
compare(todoTime.dueDateTime, dueDateTime)
compare(todoTime.value(TodoTime.FieldDueDateTime), dueDateTime)
@@ -387,7 +387,7 @@ TestCase {
compare(todoProgress.type, Detail.TodoProgress)
compare(todoProgress.value(TodoProgress.FieldFinishedDateTime), undefined)
- var finishedDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
+ var finishedDateTime = new Date("1991-08-25T20:57:08Z")
todoProgress.finishedDateTime = finishedDateTime
compare(todoProgress.finishedDateTime, finishedDateTime)
compare(todoProgress.value(TodoProgress.FieldFinishedDateTime), finishedDateTime)
@@ -407,7 +407,7 @@ TestCase {
compare(journalTime.type, Detail.JournalTime)
compare(journalTime.value(JournalTime.FieldEntryDateTime), undefined)
- var entryDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
+ var entryDateTime = new Date("1991-08-25T20:57:08Z")
journalTime.entryDateTime = entryDateTime
compare(journalTime.entryDateTime, entryDateTime)
compare(journalTime.value(JournalTime.FieldEntryDateTime), journalTime.entryDateTime)
@@ -425,12 +425,12 @@ TestCase {
compare(timestamp1.type, Detail.Timestamp)
compare(timestamp1.value(Timestamp.FieldCreated), undefined)
- var timestamp = new Date("1991-08-25 20:57:08 GMT+0000")
+ var timestamp = new Date("1991-08-25T20:57:08Z")
timestamp.created = timestamp
compare(timestamp.created, timestamp)
compare(timestamp1.value(Timestamp.FieldLastModified), undefined)
- var lastModified = new Date("1995-05-20 11:22:33 GMT+0200")
+ var lastModified = new Date("1995-05-20T11:22:33+0200")
timestamp.lastModified = lastModified
compare(timestamp.lastModified, lastModified)
}
@@ -542,13 +542,13 @@ TestCase {
compare(eventTime.value(EventTime.FieldAllDay), true)
compare(eventTime.value(EventTime.FieldStartDateTime), undefined)
- var startDateTime = new Date("1991-08-25 20:57:08 GMT+0000")
+ var startDateTime = new Date("1991-08-25T20:57:08Z")
eventTime.startDateTime = startDateTime
compare(eventTime.startDateTime, startDateTime)
compare(eventTime.value(EventTime.FieldStartDateTime), startDateTime)
compare(eventTime.value(EventTime.FieldEndDateTime), undefined)
- var endDateTime = new Date("1995-05-20 11:22:33 GMT+0200")
+ var endDateTime = new Date("1995-05-20T11:22:33+0200")
eventTime.endDateTime = endDateTime
compare(eventTime.endDateTime, endDateTime)
compare(eventTime.value(EventTime.FieldEndDateTime), endDateTime)