← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

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

Requested reviews:
  Alan Pope  (popey)

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

Confirmed by Renato
https://bugs.launchpad.net/ubuntu-calendar-app/+bug/1437305/comments/6

We save wrong end date for all day event(end date should be one day later than start date). This issue results in
1. Duplicated event display for all day event in weekly/daily view 
2. Wrong date day in monthly view

This patch fix these two issue.
-- 
Your team Ubuntu Calendar Developers is subscribed to branch lp:ubuntu-calendar-app.
=== modified file 'AllDayEventComponent.qml'
--- AllDayEventComponent.qml	2014-11-29 03:36:18 +0000
+++ AllDayEventComponent.qml	2015-06-16 09:28:53 +0000
@@ -18,6 +18,7 @@
 import QtQuick 2.3
 import Ubuntu.Components 1.1
 import Ubuntu.Components.Popups 1.0
+import QtOrganizer 5.0
 
 import "dateExt.js" as DateExt
 import "ViewType.js" as ViewType
@@ -39,7 +40,7 @@
         for(var i = 0 ; i < items.length ; ++i) {
             var event = items[(i)];
             if( event && event.allDay ) {
-                for(var d = event.startDateTime; d <= event.endDateTime; d = d.addDays(1)) {
+                for(var d = event.startDateTime; d < event.endDateTime; d = d.addDays(1)) {
                     var key = Qt.formatDateTime(d, "dd-MMM-yyyy");
                     if( !(key in map)) {
                         map[key] = [];

=== modified file 'NewEvent.qml'
--- NewEvent.qml	2015-05-22 12:25:24 +0000
+++ NewEvent.qml	2015-06-16 09:28:53 +0000
@@ -179,14 +179,17 @@
                 event = Qt.createQmlObject("import QtOrganizer 5.0; Event {}", Qt.application,"NewEvent.qml");
             }
 
+            event.allDay = allDayEventCheckbox.checked;
+
             event.startDateTime = startDate;
-            event.endDateTime = endDate;
+            if (event.allDay)
+                event.endDateTime = startDate.addDays(1);
+            else
+                event.endDateTime = endDate;
             event.displayLabel = titleEdit.text;
             event.description = messageEdit.text;
             event.location = locationEdit.text
 
-            event.allDay = allDayEventCheckbox.checked;
-
             if( event.itemType === Type.Event ) {
                 event.attendees = []; // if Edit remove all attendes & add them again if any
                 var contacts = [];

=== modified file 'po/com.ubuntu.calendar.pot'
--- po/com.ubuntu.calendar.pot	2015-06-09 10:45:01 +0000
+++ po/com.ubuntu.calendar.pot	2015-06-16 09:28:53 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-06-09 18:44+0800\n"
+"POT-Creation-Date: 2015-06-16 17:18+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"
@@ -46,13 +46,13 @@
 #. on a given day. "Ev." is short form for "Events".
 #. Please keep the translation of "Ev." to 3 characters only, as the week view
 #. where it's shown has limited space
-#: ../AllDayEventComponent.qml:122
+#: ../AllDayEventComponent.qml:123
 #, qt-format
 msgid "%1 ev."
 msgstr ""
 
 #. TRANSLATORS: the argument refers to the number of all day events
-#: ../AllDayEventComponent.qml:126
+#: ../AllDayEventComponent.qml:127
 #, qt-format
 msgid "%1 all day event"
 msgid_plural "%1 all day events"
@@ -77,8 +77,8 @@
 msgid "Syncing"
 msgstr ""
 
-#: ../CalendarChoicePopup.qml:71
-msgid "Add new Calendar"
+#: ../CalendarChoicePopup.qml:70
+msgid "Add online Calendar"
 msgstr ""
 
 #: ../ColorPickerDialog.qml:25
@@ -136,7 +136,7 @@
 msgid "Delete"
 msgstr ""
 
-#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:296
+#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:299
 msgid "Edit Event"
 msgstr ""
 
@@ -154,7 +154,7 @@
 msgid "Edit this"
 msgstr ""
 
-#: ../EventActions.qml:50 ../NewEvent.qml:296
+#: ../EventActions.qml:50 ../NewEvent.qml:299
 msgid "New Event"
 msgstr ""
 
@@ -165,7 +165,7 @@
 msgid "%1 <b>%2</b>"
 msgstr ""
 
-#: ../EventDetails.qml:42 ../NewEvent.qml:407
+#: ../EventDetails.qml:42 ../NewEvent.qml:410
 msgid "Event Details"
 msgstr ""
 
@@ -189,11 +189,11 @@
 msgid "Edit"
 msgstr ""
 
-#: ../EventDetails.qml:347 ../NewEvent.qml:509
+#: ../EventDetails.qml:347 ../NewEvent.qml:512
 msgid "Guests"
 msgstr ""
 
-#: ../EventDetails.qml:390 ../EventReminder.qml:35 ../NewEvent.qml:606
+#: ../EventDetails.qml:390 ../EventReminder.qml:35 ../NewEvent.qml:609
 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:590
+#: ../EventRepetition.qml:237 ../NewEvent.qml:593
 msgid "Repeats"
 msgstr ""
 
@@ -267,43 +267,43 @@
 msgid "End time can't be before start time"
 msgstr ""
 
-#: ../NewEvent.qml:306
+#: ../NewEvent.qml:309
 msgid "Error"
 msgstr ""
 
-#: ../NewEvent.qml:308
+#: ../NewEvent.qml:311
 msgid "OK"
 msgstr ""
 
-#: ../NewEvent.qml:361
+#: ../NewEvent.qml:364
 msgid "From"
 msgstr ""
 
-#: ../NewEvent.qml:374
+#: ../NewEvent.qml:377
 msgid "To"
 msgstr ""
 
-#: ../NewEvent.qml:391
+#: ../NewEvent.qml:394
 msgid "All day event"
 msgstr ""
 
-#: ../NewEvent.qml:420
+#: ../NewEvent.qml:423
 msgid "Event Name"
 msgstr ""
 
-#: ../NewEvent.qml:438
+#: ../NewEvent.qml:441
 msgid "Description"
 msgstr ""
 
-#: ../NewEvent.qml:456
+#: ../NewEvent.qml:459
 msgid "Location"
 msgstr ""
 
-#: ../NewEvent.qml:471 com.ubuntu.calendar_calendar.desktop.in.in.h:1
+#: ../NewEvent.qml:474 com.ubuntu.calendar_calendar.desktop.in.in.h:1
 msgid "Calendar"
 msgstr ""
 
-#: ../NewEvent.qml:513
+#: ../NewEvent.qml:516
 msgid "Add Guest"
 msgstr ""
 


Follow ups