Merge lp:~themeles/ubuntu-clock-app/bugfix-1442518 into lp:ubuntu-clock-app

Proposed by themeles on 2015-06-14
Status: Merged
Approved by: Nekhelesh Ramananthan on 2015-06-16
Approved revision: 280
Merged at revision: 279
Proposed branch: lp:~themeles/ubuntu-clock-app/bugfix-1442518
Merge into: lp:ubuntu-clock-app
Diff against target: 54 lines (+12/-10)
3 files modified
app/alarm/AlarmDelegate.qml (+7/-8)
debian/changelog (+4/-1)
po/com.ubuntu.clock.pot (+1/-1)
To merge this branch: bzr merge lp:~themeles/ubuntu-clock-app/bugfix-1442518
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-06-14
Nekhelesh Ramananthan 2015-06-14 Approve on 2015-06-14
Review via email: mp+261910@code.launchpad.net

Commit Message

Fixes alarms after midnight being incorrectly enabled for the next day.

Description of the Change

This MP should fix alarms after midnight being incorrectly enabled for the next day. This fix was possible due to the help of nik90. Thnx!

Steps to test
1. Open clock app and create an alarm for 10:00 AM and disable it.
2. Close clock app
3. Set time manually to sometime after midnight like 01:10 AM using the system settings app and date to tomorrow or the date after.
4. Open clock app
5. Try enabling the alarms which were disabled in the first step.

The alarms should be schedule for that day 10:00 AM instead of the next day since it is past midnight.

To post a comment you must log in.
278. By themeles on 2015-06-14

[themeles]
Fixes alarms after midnight being incorrectly enabled for the next day.

279. By themeles on 2015-06-14

Varaibles now and currentTime were the same. Just using now.

Nekhelesh Ramananthan (nik90) wrote :

Couple minor typos (I'm being nitpicky now)
- The debian changelog entry should include the bug number..so please append (LP: #1442518) to the end of that sentence.

- var now=new Date() should be var now = new Date() to maintain consistency

- Please leave gaps between the arguments in alarmData.date = new Date(now.getFullYear(),now.getMonth(),now.getDate()+1,alarmData.date.getHours(),alarmData.date.getMinutes(),0,0)

it should look like

alarmData.date = new Date(now.getFullYear(), now.getMonth(), now.getDate()+1, alarmData.date.getHours(), alarmData.date.getMinutes(), 0, 0)

This will improve clarity

review: Needs Fixing
280. By themeles on 2015-06-14

correcting minor typos
Fixes alarms after midnight being incorrectly enabled for the next day. (LP: #1442518)

Nekhelesh Ramananthan (nik90) wrote :

lgtm! Let's test this for a few days before top-approving and merging.

review: Approve
Nekhelesh Ramananthan (nik90) wrote :

After 2 days of testing, this patch works as expected. Top approving now.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/alarm/AlarmDelegate.qml'
2--- app/alarm/AlarmDelegate.qml 2015-01-22 00:11:57 +0000
3+++ app/alarm/AlarmDelegate.qml 2015-06-14 17:16:36 +0000
4@@ -100,14 +100,13 @@
5 gone-off and the user is re-enabling the alarm. Repeating
6 alarms do this automatically.
7 */
8- if(checked && type === Alarm.OneTime && alarmData.date < new Date()) {
9- var currentTime = new Date()
10- alarmData.daysOfWeek = alarmUtils.get_alarm_day(currentTime.getDay())
11-
12- if (alarmData.date.getTime() <= currentTime.getTime()) {
13- var tomorrow = currentTime
14- tomorrow.setDate(tomorrow.getDate() + 1)
15- alarmData.daysOfWeek = alarmUtils.get_alarm_day(tomorrow.getDay())
16+ if(checked && type === Alarm.OneTime) {
17+ alarmData.daysOfWeek = Alarm.AutoDetect
18+ var now = new Date()
19+ if (alarmData.date.getHours()*60+alarmData.date.getMinutes() <= now.getHours()*60+now.getMinutes()) {
20+ alarmData.date = new Date(now.getFullYear(), now.getMonth(), now.getDate()+1, alarmData.date.getHours(), alarmData.date.getMinutes(), 0, 0)
21+ } else {
22+ alarmData.date = new Date(now.getFullYear(), now.getMonth(), now.getDate(), alarmData.date.getHours(), alarmData.date.getMinutes(), 0, 0)
23 }
24 }
25
26
27=== modified file 'debian/changelog'
28--- debian/changelog 2015-05-26 14:40:39 +0000
29+++ debian/changelog 2015-06-14 17:16:36 +0000
30@@ -22,7 +22,10 @@
31 location access (LP: #1393827)
32 * Increased date font size (LP: #1432736)
33 * Fixed empty state component width warnings
34-
35+
36+ [themeles]
37+ * Fixes alarms after midnight being incorrectly enabled for the next day. (LP: #1442518)
38+
39 [Penk Chen]
40 * Fixed DigitalMode time being empty in chineese locale (LP: #1458808)
41
42
43=== modified file 'po/com.ubuntu.clock.pot'
44--- po/com.ubuntu.clock.pot 2015-05-26 14:38:54 +0000
45+++ po/com.ubuntu.clock.pot 2015-06-14 17:16:36 +0000
46@@ -8,7 +8,7 @@
47 msgstr ""
48 "Project-Id-Version: \n"
49 "Report-Msgid-Bugs-To: \n"
50-"POT-Creation-Date: 2015-05-26 14:38+0000\n"
51+"POT-Creation-Date: 2015-06-14 16:23+0200\n"
52 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
53 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
54 "Language-Team: LANGUAGE <LL@li.org>\n"

Subscribers

People subscribed via source and target branches