Merge lp:~renatofilho/ubuntu-calendar-app/fix-1563742 into lp:ubuntu-calendar-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Arthur Mello
Approved revision: 818
Merged at revision: 817
Proposed branch: lp:~renatofilho/ubuntu-calendar-app/fix-1563742
Merge into: lp:ubuntu-calendar-app
Diff against target: 103 lines (+66/-1)
3 files modified
calendar_canvas.js (+7/-0)
click/calendar.apparmor (+3/-0)
tests/unittests/tst_calendar_canvas.qml (+56/-1)
To merge this branch: bzr merge lp:~renatofilho/ubuntu-calendar-app/fix-1563742
Reviewer Review Type Date Requested Status
Arthur Mello (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+290901@code.launchpad.net

Commit message

Fixed event drawing during the DST change.

Added /etc/writable/timezone as read path on apparmor file.
This is necessary by qtorganizer5-eds to retrieve device timezone.

Description of the change

OBS: You need silo 39 to test it
https://requests.ci-train.ubuntu.com/#/ticket/1213

How to test:

1 - Change your device tz to Europe/Paris
2 - Create a event at 7AM until 8AM before 27th March that repeats every day

Expected result:
Check if the event appears on the same time (7AM-8AM) on 26, 27, 28 of March and all other days

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)
815. By Renato Araujo Oliveira Filho

Fix event drawing on DST change.

816. By Renato Araujo Oliveira Filho

Fixed apparmor invalid syntax.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
817. By Renato Araujo Oliveira Filho

Added tests for events in multiple days.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
818. By Renato Araujo Oliveira Filho

Remove empty line.

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Arthur Mello (artmello) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'calendar_canvas.js'
--- calendar_canvas.js 2016-03-21 21:28:31 +0000
+++ calendar_canvas.js 2016-04-05 14:44:53 +0000
@@ -8,6 +8,13 @@
8 var untilTime = new Date(until)8 var untilTime = new Date(until)
9 untilTime.setSeconds(0)9 untilTime.setSeconds(0)
1010
11 // We need that to avoid problems with DST times
12 // Without this the event will be showed in the wrong time on the day that the DST occur
13 // Example: 27/03 (Europe/Paris)
14 if (sinceTime.isSameDay(untilTime)) {
15 return (untilTime.getHours() * 60) + untilTime.getMinutes();
16 }
17
11 var sinceTimeInSecs = sinceTime.getTime()18 var sinceTimeInSecs = sinceTime.getTime()
12 var untilTimeInSecs = untilTime.getTime()19 var untilTimeInSecs = untilTime.getTime()
1320
1421
=== modified file 'click/calendar.apparmor'
--- click/calendar.apparmor 2016-03-03 21:42:08 +0000
+++ click/calendar.apparmor 2016-04-05 14:44:53 +0000
@@ -6,5 +6,8 @@
6 "accounts",6 "accounts",
7 "push-notification-client"7 "push-notification-client"
8 ],8 ],
9 "read_path": [
10 "/etc/writable/timezone"
11 ],
9 "policy_version": 1.312 "policy_version": 1.3
10}13}
1114
=== modified file 'tests/unittests/tst_calendar_canvas.qml'
--- tests/unittests/tst_calendar_canvas.qml 2016-03-30 10:42:57 +0000
+++ tests/unittests/tst_calendar_canvas.qml 2016-04-05 14:44:53 +0000
@@ -16,7 +16,7 @@
1616
17 manager: "memory"17 manager: "memory"
18 startPeriod: new Date(2016, 7, 2, 0, 0, 0, 0)18 startPeriod: new Date(2016, 7, 2, 0, 0, 0, 0)
19 endPeriod: new Date(2016, 13, 2, 0, 0, 0, 0)19 endPeriod: new Date(2016, 11, 2, 0, 0, 0, 0)
20 autoUpdate: true20 autoUpdate: true
21 }21 }
22 }22 }
@@ -669,4 +669,59 @@
669 compare(eventsE.intersectionCount, 5)669 compare(eventsE.intersectionCount, 5)
670 fuzzyCompare(eventsE.width, 0.3, 0.1)670 fuzzyCompare(eventsE.width, 0.3, 0.1)
671 }671 }
672
673 // Event starts a day before
674 // 00:00 |XX| ----
675 // |XX| ----
676 // 01:00 ---- ----
677 function test_starts_a_day_before()
678 {
679 var data = [{startDate: new Date(2016, 7, 2, 23, 0, 0, 0),
680 endDate: new Date(2016, 7, 3, 1, 0, 0, 0),
681 label: "Event at 23:00 until 1:00"}
682 ]
683 var model = create_events(data)
684
685 var startDate = new Date(2016, 7, 3, 11, 11, 11, 11)
686 worker.start(model, startDate)
687 tryCompare(worker, 'done', true)
688 var eventMap = worker.reply
689
690 // "Event at 23:00 until 1:00"
691 var eventsA = eventMap[0]
692 compare(eventsA.event.displayLabel, "Event at 23:00 until 1:00")
693 compare(eventsA.y, 0)
694 compare(eventsA.startTime, 0)
695 compare(eventsA.endTime, 60)
696 compare(eventsA.intersectionCount, 1)
697 fuzzyCompare(eventsA.width, 1.0, 0.0)
698 }
699
700 // Event ends a day after
701 // 22:00 |XX| ----
702 // |XX| ----
703 // 23:00 |XX| ----
704 /// |XX| ----
705 function test_ends_a_day_after()
706 {
707 var data = [{startDate: new Date(2016, 7, 2, 22, 0, 0, 0),
708 endDate: new Date(2016, 7, 3, 1, 0, 0, 0),
709 label: "Event at 22:00 until 1:00"}
710 ]
711 var model = create_events(data)
712
713 var startDate = new Date(2016, 7, 2, 0, 0, 0, 0)
714 worker.start(model, startDate)
715 tryCompare(worker, 'done', true)
716 var eventMap = worker.reply
717
718 // "Event at 22:00 until 1:00"
719 var eventsA = eventMap[0]
720 compare(eventsA.event.displayLabel, "Event at 22:00 until 1:00")
721 compare(eventsA.y, 0)
722 compare(eventsA.intersectionCount, 1)
723 fuzzyCompare(eventsA.startTime, 1320, 0.1)
724 fuzzyCompare(eventsA.endTime, 1440, 0.1)
725 fuzzyCompare(eventsA.width, 1.0, 0.0)
726 }
672}727}

Subscribers

People subscribed via source and target branches

to status/vote changes: