Merge lp:~martin-borho/ubuntu-weather-app/twc_5day_forecast into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Martin Borho
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 228
Merged at revision: 230
Proposed branch: lp:~martin-borho/ubuntu-weather-app/twc_5day_forecast
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 28 lines (+6/-5)
1 file modified
components/WeatherApi.js (+6/-5)
To merge this branch: bzr merge lp:~martin-borho/ubuntu-weather-app/twc_5day_forecast
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+215269@code.launchpad.net

Commit message

Limiting TWC forecast to 5 days according guidelines

Description of the change

Limiting TWC forecast to 5 days according guidelines

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
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Looks great, thanks Martin!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components/WeatherApi.js'
--- components/WeatherApi.js 2014-03-31 14:53:17 +0000
+++ components/WeatherApi.js 2014-04-10 18:08:52 +0000
@@ -518,10 +518,11 @@
518 if(location.services && !location.services[_serviceName] && data["location"].key) {518 if(location.services && !location.services[_serviceName] && data["location"].key) {
519 location.services[_serviceName] = data["location"].key519 location.services[_serviceName] = data["location"].key
520 } 520 }
521 //521 // only 5 days of forecast for TWC
522 data["daily"].forEach(function(dayData) {522 for(var x=0;x<5;x++) {
523 var date = getLocationTime(((dayData.validDate*1000)-1000)+offset), // minus 1 sec to handle +/-12 TZ523 var dayData = data["daily"][x],
524 day = date.year+"-"+date.month+"-"+date.date;524 date = getLocationTime(((dayData.validDate*1000)-1000)+offset); // minus 1 sec to handle +/-12 TZ
525 day = date.year+"-"+date.month+"-"+date.date;
525 if(!todayDate) {526 if(!todayDate) {
526 if(localNow.year+"-"+localNow.month+"-"+localNow.date > day) {527 if(localNow.year+"-"+localNow.month+"-"+localNow.date > day) {
527 // skip "yesterday"528 // skip "yesterday"
@@ -530,7 +531,7 @@
530 todayDate = date;531 todayDate = date;
531 }532 }
532 tmpResult[day] = _buildDayFormat(date, dayData, nowMs);533 tmpResult[day] = _buildDayFormat(date, dayData, nowMs);
533 })534 }
534 //535 //
535 if(data["current"]) {536 if(data["current"]) {
536 var today = todayDate.year+"-"+todayDate.month+"-"+todayDate.date537 var today = todayDate.year+"-"+todayDate.month+"-"+todayDate.date

Subscribers

People subscribed via source and target branches