← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~gary-wzl77/ubuntu-calendar-app/fix_1466667 into lp:ubuntu-calendar-app

 

Gary.Wang has proposed merging lp:~gary-wzl77/ubuntu-calendar-app/fix_1466667 into lp:ubuntu-calendar-app.

Commit message:
Retain time difference between end and start date when editing

Requested reviews:
  Alan Pope  (popey)

For more details, see:
https://code.launchpad.net/~gary-wzl77/ubuntu-calendar-app/fix_1466667/+merge/262748

Retain time difference between end and start date when editing.
-- 
Your team Ubuntu Calendar Developers is subscribed to branch lp:ubuntu-calendar-app.
=== modified file 'NewEvent.qml'
--- NewEvent.qml	2015-06-19 13:05:13 +0000
+++ NewEvent.qml	2015-06-23 16:05:56 +0000
@@ -48,7 +48,14 @@
 
     onStartDateChanged: {
         startDateTimeInput.dateTime = startDate;
-        adjustEndDateToStartDate()
+
+        // set time forward to one hour
+        var time_forward = 3600000;
+
+        if (isEdit && event !== null) {
+            time_forward = event.endDateTime - event.startDateTime;
+        }
+        adjustEndDateToStartDate(time_forward);
     }
 
     onEndDateChanged: {
@@ -272,9 +279,7 @@
         return tempDate.setHours(tempDate.getHours() + 1)
     }
 
-    function adjustEndDateToStartDate() {
-        // set time forward to one hour
-        var time_forward = 3600000;
+    function adjustEndDateToStartDate(time_forward) {
         endDate = new Date( startDate.getTime() + time_forward );
     }
 

=== modified file 'po/com.ubuntu.calendar.pot'
--- po/com.ubuntu.calendar.pot	2015-06-21 08:29:02 +0000
+++ po/com.ubuntu.calendar.pot	2015-06-23 16:05:56 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-06-21 16:27+0800\n"
+"POT-Creation-Date: 2015-06-23 23:57+0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -136,7 +136,7 @@
 msgid "Delete"
 msgstr ""
 
-#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:299
+#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:304
 msgid "Edit Event"
 msgstr ""
 
@@ -154,7 +154,7 @@
 msgid "Edit this"
 msgstr ""
 
-#: ../EventActions.qml:50 ../NewEvent.qml:299
+#: ../EventActions.qml:50 ../NewEvent.qml:304
 msgid "New Event"
 msgstr ""
 
@@ -165,7 +165,7 @@
 msgid "%1 <b>%2</b>"
 msgstr ""
 
-#: ../EventDetails.qml:42 ../NewEvent.qml:410
+#: ../EventDetails.qml:42 ../NewEvent.qml:415
 msgid "Event Details"
 msgstr ""
 
@@ -189,11 +189,11 @@
 msgid "Edit"
 msgstr ""
 
-#: ../EventDetails.qml:352 ../NewEvent.qml:512
+#: ../EventDetails.qml:352 ../NewEvent.qml:517
 msgid "Guests"
 msgstr ""
 
-#: ../EventDetails.qml:395 ../EventReminder.qml:35 ../NewEvent.qml:609
+#: ../EventDetails.qml:395 ../EventReminder.qml:35 ../NewEvent.qml:614
 msgid "Reminder"
 msgstr ""
 
@@ -216,7 +216,7 @@
 #. TRANSLATORS: this refers to how often a recurrent event repeats
 #. and it is shown as the header of the option selector to choose
 #. its repetition
-#: ../EventRepetition.qml:237 ../NewEvent.qml:593
+#: ../EventRepetition.qml:237 ../NewEvent.qml:598
 msgid "Repeats"
 msgstr ""
 
@@ -259,51 +259,51 @@
 msgid "After Date"
 msgstr ""
 
-#: ../NewEvent.qml:61
+#: ../NewEvent.qml:68
 msgid "Save"
 msgstr ""
 
-#: ../NewEvent.qml:170
+#: ../NewEvent.qml:177
 msgid "End time can't be before start time"
 msgstr ""
 
-#: ../NewEvent.qml:309
+#: ../NewEvent.qml:314
 msgid "Error"
 msgstr ""
 
-#: ../NewEvent.qml:311
+#: ../NewEvent.qml:316
 msgid "OK"
 msgstr ""
 
-#: ../NewEvent.qml:364
+#: ../NewEvent.qml:369
 msgid "From"
 msgstr ""
 
-#: ../NewEvent.qml:377
+#: ../NewEvent.qml:382
 msgid "To"
 msgstr ""
 
-#: ../NewEvent.qml:394
+#: ../NewEvent.qml:399
 msgid "All day event"
 msgstr ""
 
-#: ../NewEvent.qml:423
+#: ../NewEvent.qml:428
 msgid "Event Name"
 msgstr ""
 
-#: ../NewEvent.qml:441
+#: ../NewEvent.qml:446
 msgid "Description"
 msgstr ""
 
-#: ../NewEvent.qml:459
+#: ../NewEvent.qml:464
 msgid "Location"
 msgstr ""
 
-#: ../NewEvent.qml:474 com.ubuntu.calendar_calendar.desktop.in.in.h:1
+#: ../NewEvent.qml:479 com.ubuntu.calendar_calendar.desktop.in.in.h:1
 msgid "Calendar"
 msgstr ""
 
-#: ../NewEvent.qml:516
+#: ../NewEvent.qml:521
 msgid "Add Guest"
 msgstr ""
 


Follow ups