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

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
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 Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
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.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
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
=== modified file 'app/data/WeatherApi.js'
--- app/data/WeatherApi.js 2015-10-20 01:37:34 +0000
+++ app/data/WeatherApi.js 2015-10-21 02:20:20 +0000
@@ -553,9 +553,9 @@
553 }553 }
554 tmpResult[day] = _buildDayFormat(date, dayData, nowMs);554 tmpResult[day] = _buildDayFormat(date, dayData, nowMs);
555 var timezoneOffset = new Date().getTimezoneOffset();555 var timezoneOffset = new Date().getTimezoneOffset();
556 var offset = (location.timezone && location.timezone.dstOffset !== undefined) ? (location.timezone.dstOffset*60 + timezoneOffset)*60*1000: 0556 var timesOffset = (location.timezone && location.timezone.dstOffset !== undefined) ? (location.timezone.dstOffset*60 + timezoneOffset)*60*1000: 0
557 var sunrise = new Date(sunRiseSet.rise*1000 + offset);557 var sunrise = new Date(sunRiseSet.rise*1000 + timesOffset);
558 var sunset = new Date(sunRiseSet.set*1000 + offset);558 var sunset = new Date(sunRiseSet.set*1000 + timesOffset);
559 var options = { timeZone: location.timezone.timeZoneId, timeZoneName: 'long' };559 var options = { timeZone: location.timezone.timeZoneId, timeZoneName: 'long' };
560 tmpResult[day].sunrise = sunrise.toLocaleTimeString(Qt.locale().name, options);560 tmpResult[day].sunrise = sunrise.toLocaleTimeString(Qt.locale().name, options);
561 tmpResult[day].sunset = sunset.toLocaleTimeString(Qt.locale().name, options);561 tmpResult[day].sunset = sunset.toLocaleTimeString(Qt.locale().name, options);
562562
=== modified file 'debian/changelog'
--- debian/changelog 2015-10-18 22:57:34 +0000
+++ debian/changelog 2015-10-21 02:20:20 +0000
@@ -31,6 +31,7 @@
31 * Show the bottom loading animation (LoadingIndicator) on the LocationsPage. (LP: #1490040)31 * Show the bottom loading animation (LoadingIndicator) on the LocationsPage. (LP: #1490040)
32 * Add FakeHeader component to ease the bottom edge transition.32 * Add FakeHeader component to ease the bottom edge transition.
33 * Use the timezone of the Location to display sunrise/sunset times.33 * Use the timezone of the Location to display sunrise/sunset times.
34 * Fix variable name clash that caused unintented consequences.
3435
35 [ Andrew Hayzen ]36 [ Andrew Hayzen ]
36 * Add mocked locations for autopilot and add a test using the data37 * Add mocked locations for autopilot and add a test using the data

Subscribers

People subscribed via source and target branches

to all changes: