Merge lp:~vthompson/ubuntu-weather-app/fix-var-name-clash into lp:ubuntu-weather-app

Proposed by Victor Thompson on 2015-10-21
Status: Merged
Approved by: Andrew Hayzen on 2015-10-21
Approved revision: 146
Merged at revision: 147
Proposed branch: lp:~vthompson/ubuntu-weather-app/fix-var-name-clash
Merge into: lp:ubuntu-weather-app
Diff against target: 28 lines (+4/-3)
2 files modified
app/data/WeatherApi.js (+3/-3)
debian/changelog (+1/-0)
To merge this branch: bzr merge lp:~vthompson/ubuntu-weather-app/fix-var-name-clash
Reviewer Review Type Date Requested Status
Andrew Hayzen 2015-10-21 Approve on 2015-10-21
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-10-21
Review via email: mp+275118@code.launchpad.net

Commit message

* Fix variable name clash that caused the hourly forecast to use the wrong offset.

Description of the change

* Fix variable name clash that caused the hourly forecast to use the wrong offset.

The previous MP caused a regression in the hourly forecast times, such that they were offset by the current location's timezone offset.

To post a comment you must log in.
review: Approve (continuous-integration)
Andrew Hayzen (ahayzen) wrote :

LGTM, as noted when testing OWM is 3hr blocks and TWC is 1hr causing a slight difference between them.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/data/WeatherApi.js'
2--- app/data/WeatherApi.js 2015-10-20 01:37:34 +0000
3+++ app/data/WeatherApi.js 2015-10-21 02:20:20 +0000
4@@ -553,9 +553,9 @@
5 }
6 tmpResult[day] = _buildDayFormat(date, dayData, nowMs);
7 var timezoneOffset = new Date().getTimezoneOffset();
8- var offset = (location.timezone && location.timezone.dstOffset !== undefined) ? (location.timezone.dstOffset*60 + timezoneOffset)*60*1000: 0
9- var sunrise = new Date(sunRiseSet.rise*1000 + offset);
10- var sunset = new Date(sunRiseSet.set*1000 + offset);
11+ var timesOffset = (location.timezone && location.timezone.dstOffset !== undefined) ? (location.timezone.dstOffset*60 + timezoneOffset)*60*1000: 0
12+ var sunrise = new Date(sunRiseSet.rise*1000 + timesOffset);
13+ var sunset = new Date(sunRiseSet.set*1000 + timesOffset);
14 var options = { timeZone: location.timezone.timeZoneId, timeZoneName: 'long' };
15 tmpResult[day].sunrise = sunrise.toLocaleTimeString(Qt.locale().name, options);
16 tmpResult[day].sunset = sunset.toLocaleTimeString(Qt.locale().name, options);
17
18=== modified file 'debian/changelog'
19--- debian/changelog 2015-10-18 22:57:34 +0000
20+++ debian/changelog 2015-10-21 02:20:20 +0000
21@@ -31,6 +31,7 @@
22 * Show the bottom loading animation (LoadingIndicator) on the LocationsPage. (LP: #1490040)
23 * Add FakeHeader component to ease the bottom edge transition.
24 * Use the timezone of the Location to display sunrise/sunset times.
25+ * Fix variable name clash that caused unintented consequences.
26
27 [ Andrew Hayzen ]
28 * Add mocked locations for autopilot and add a test using the data

Subscribers

People subscribed via source and target branches

to all changes: