← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

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

Commit message:
1.fix display bug for multiple all day events
2.skip event bubble display in case of endDateTime == dd-MM-yyyy 12:00 AM

Requested reviews:
  Alan Pope  (popey)

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

1.fix display bug for multiple all day events
2.skip event bubble display in case of endDateTime == dd-MM-yyyy 12:00 AM
-- 
Your team Ubuntu Calendar Developers is subscribed to branch lp:ubuntu-calendar-app.
=== modified file 'EventDetails.qml'
--- EventDetails.qml	2015-06-27 17:52:44 +0000
+++ EventDetails.qml	2015-07-08 13:39:43 +0000
@@ -23,6 +23,7 @@
 import QtOrganizer 5.0
 
 import "Defines.js" as Defines
+import "dateExt.js" as DateExt
 
 Page {
     id: root
@@ -114,10 +115,11 @@
         var endTime = e.endDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
 
         if( e.allDay ) {
-            if( !e.startDateTime.isSameDay( e.endDateTime) ) {
+            var days = Math.floor((e.endDateTime - e.startDateTime) / Date.msPerDay);
+            if( days !== 1 ) {
                 dateLabel.text = i18n.tr("%1 - %2 (All Day)")
                 .arg( e.startDateTime.toLocaleDateString(Qt.locale(), Locale.LongFormat))
-                .arg( e.endDateTime.toLocaleDateString(Qt.locale(), Locale.LongFormat))
+                .arg( e.endDateTime.addDays(-1).toLocaleDateString(Qt.locale(), Locale.LongFormat))
             } else {
                 dateLabel.text = i18n.tr("%1 (All Day)").arg( e.startDateTime.toLocaleDateString(Qt.locale(), Locale.LongFormat))
             }

=== modified file 'NewEvent.qml'
--- NewEvent.qml	2015-06-27 17:52:44 +0000
+++ NewEvent.qml	2015-07-08 13:39:43 +0000
@@ -155,6 +155,7 @@
         }
         if(e.allDay){
             allDayEventCheckbox.checked =true;
+            endDate = endDate.addDays(-1);
         }
 
         if(e.location) {
@@ -202,12 +203,14 @@
             }
 
             event.allDay = allDayEventCheckbox.checked;
-
             event.startDateTime = startDate;
-            if (event.allDay)
-                event.endDateTime = startDate.addDays(1);
-            else
+
+            if (event.allDay){
+                event.endDateTime = endDate.addDays(1);
+            } else {
                 event.endDateTime = endDate;
+            }
+
             event.displayLabel = titleEdit.text;
             event.description = messageEdit.text;
             event.location = locationEdit.text

=== modified file 'TimeLineBase.qml'
--- TimeLineBase.qml	2015-06-21 08:29:02 +0000
+++ TimeLineBase.qml	2015-07-08 13:39:43 +0000
@@ -224,6 +224,10 @@
         var hour = 0;
         var durationMin = 0;
 
+        // skip it in case of endDateTime == dd-MM-yyyy 12:00 AM
+        if (event.endDateTime - day  == 0)
+            return;
+
         if (event.endDateTime.getDate() - day.getDate() == 0 &&
                 event.startDateTime.getDate() - day.getDate() == 0) {
             hour = event.startDateTime.getHours();
@@ -244,8 +248,8 @@
             yPos = (( event.startDateTime.getMinutes() * hourHeight) / 60) + hour * hourHeight
             durationMin = (24 - event.startDateTime.getHours()) * 60;
         }
-        if (event.endDateTime - day > Date.msPerDay &&
-                event.startDateTime- day < 0) {
+        if (event.endDateTime - day  >= Date.msPerDay &&
+                event.startDateTime- day <= 0) {
             hour = 0;
             yPos = 0;
             durationMin = 24 * 60;

=== modified file 'po/com.ubuntu.calendar.pot'
--- po/com.ubuntu.calendar.pot	2015-06-23 15:59:08 +0000
+++ po/com.ubuntu.calendar.pot	2015-07-08 13:39:43 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-06-23 23:57+0800\n"
+"POT-Creation-Date: 2015-07-08 21:32+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"
@@ -132,11 +132,11 @@
 msgid "Delete this"
 msgstr ""
 
-#: ../DeleteConfirmationDialog.qml:51 ../EventDetails.qml:188
+#: ../DeleteConfirmationDialog.qml:51 ../NewEvent.qml:68
 msgid "Delete"
 msgstr ""
 
-#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:304
+#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:322
 msgid "Edit Event"
 msgstr ""
 
@@ -154,7 +154,7 @@
 msgid "Edit this"
 msgstr ""
 
-#: ../EventActions.qml:50 ../NewEvent.qml:304
+#: ../EventActions.qml:50 ../NewEvent.qml:322
 msgid "New Event"
 msgstr ""
 
@@ -165,35 +165,35 @@
 msgid "%1 <b>%2</b>"
 msgstr ""
 
-#: ../EventDetails.qml:42 ../NewEvent.qml:415
+#: ../EventDetails.qml:43 ../NewEvent.qml:433
 msgid "Event Details"
 msgstr ""
 
 #. TRANSLATORS: the first parameter refers to the name of event calendar.
-#: ../EventDetails.qml:66
+#: ../EventDetails.qml:67
 #, qt-format
 msgid "%1 Calendar"
 msgstr ""
 
-#: ../EventDetails.qml:118
+#: ../EventDetails.qml:120
 #, qt-format
 msgid "%1 - %2 (All Day)"
 msgstr ""
 
-#: ../EventDetails.qml:122
+#: ../EventDetails.qml:124
 #, qt-format
 msgid "%1 (All Day)"
 msgstr ""
 
-#: ../EventDetails.qml:201
+#: ../EventDetails.qml:194
 msgid "Edit"
 msgstr ""
 
-#: ../EventDetails.qml:352 ../NewEvent.qml:517
+#: ../EventDetails.qml:345 ../NewEvent.qml:535
 msgid "Guests"
 msgstr ""
 
-#: ../EventDetails.qml:395 ../EventReminder.qml:35 ../NewEvent.qml:614
+#: ../EventDetails.qml:388 ../EventReminder.qml:35 ../NewEvent.qml:632
 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:598
+#: ../EventRepetition.qml:237 ../NewEvent.qml:616
 msgid "Repeats"
 msgstr ""
 
@@ -259,51 +259,51 @@
 msgid "After Date"
 msgstr ""
 
-#: ../NewEvent.qml:68
+#: ../NewEvent.qml:84
 msgid "Save"
 msgstr ""
 
-#: ../NewEvent.qml:177
+#: ../NewEvent.qml:193
 msgid "End time can't be before start time"
 msgstr ""
 
-#: ../NewEvent.qml:314
+#: ../NewEvent.qml:332
 msgid "Error"
 msgstr ""
 
-#: ../NewEvent.qml:316
+#: ../NewEvent.qml:334
 msgid "OK"
 msgstr ""
 
-#: ../NewEvent.qml:369
+#: ../NewEvent.qml:387
 msgid "From"
 msgstr ""
 
-#: ../NewEvent.qml:382
+#: ../NewEvent.qml:400
 msgid "To"
 msgstr ""
 
-#: ../NewEvent.qml:399
+#: ../NewEvent.qml:417
 msgid "All day event"
 msgstr ""
 
-#: ../NewEvent.qml:428
+#: ../NewEvent.qml:446
 msgid "Event Name"
 msgstr ""
 
-#: ../NewEvent.qml:446
+#: ../NewEvent.qml:464
 msgid "Description"
 msgstr ""
 
-#: ../NewEvent.qml:464
+#: ../NewEvent.qml:482
 msgid "Location"
 msgstr ""
 
-#: ../NewEvent.qml:479 com.ubuntu.calendar_calendar.desktop.in.in.h:1
+#: ../NewEvent.qml:497 com.ubuntu.calendar_calendar.desktop.in.in.h:1
 msgid "Calendar"
 msgstr ""
 
-#: ../NewEvent.qml:521
+#: ../NewEvent.qml:539
 msgid "Add Guest"
 msgstr ""
 


Follow ups