Merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_set_date_new_event into lp:ubuntu-calendar-app

Proposed by Arthur Mello
Status: Merged
Approved by: Renato Araujo Oliveira Filho
Approved revision: 801
Merged at revision: 801
Proposed branch: lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_set_date_new_event
Merge into: lp:ubuntu-calendar-app
Diff against target: 18 lines (+6/-2)
1 file modified
NewEvent.qml (+6/-2)
To merge this branch: bzr merge lp:~artmello/ubuntu-calendar-app/ubuntu-calendar-app-fix_set_date_new_event
Reviewer Review Type Date Requested Status
Renato Araujo Oliveira Filho (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+289960@code.launchpad.net

Commit message

Make sure that startDate/endDate is defined before setting date time

Description of the change

Currently we can see this when creating a new event from "New Event" bottom edge: file:///opt/click.ubuntu.com/com.ubuntu.calendar/0.5.800/NewEvent.qml:329: Error: Cannot assign [undefined] to QDateTime

This MR checks if property is undefined before setting it.

Tests necessary:
----------------
1. Make sure that events with same start/end time imported from google will be displayed with correct colors if they are past or future ones;
2. Make sure that events with different start/end time imported from google will be displayed with correct colors if they are past or future ones;
3. Make sure that when editing an existing event the correct start/end time are displayed
4. Make sure that when creating a new event it has the correct start/end time
5. Guarantee that no error is displayed while executing the above

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

works nice

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NewEvent.qml'
2--- NewEvent.qml 2016-03-23 13:02:47 +0000
3+++ NewEvent.qml 2016-03-23 19:02:41 +0000
4@@ -326,9 +326,13 @@
5
6 onEndDateChanged: {
7 if (!root.endDate || isNaN(root.endDate.getTime())) {
8- endDateTimeInput.dateTime = startDate;
9+ if (root.startDate) {
10+ endDateTimeInput.dateTime = root.startDate;
11+ }
12 } else {
13- endDateTimeInput.dateTime = endDate;
14+ if (root.endDate) {
15+ endDateTimeInput.dateTime = root.endDate;
16+ }
17 }
18 }
19

Subscribers

People subscribed via source and target branches

to status/vote changes: