Commit ff6d2bae authored by Zach Knox's avatar Zach Knox

Week forecast now shows proper data.

But doesn't want to show the right day of the week...
parent 95b2fa05
......@@ -44,83 +44,26 @@
</tbody>
</table>
</div>
{{#each dayWeather in weatherData.data.daily.data}}
<div class="mdl-cell mdl-cell--4-col">
<div class="out-of-focus-card mdl-card mdl-shadow--4dp">
<div class="mdl-card__title">
<h1 class="mdl-card__title-text">Tomorrow<br /></h1>
<h1 class="mdl-card__title-text">{{getDayNameFromTime dayWeather.time}}<br /></h1>
</div>
<div class="mdl-card__supporting-text">
<h5>Partly Cloudy</h5>
<h5>{{dayWeather.summary}}</h5>
<div class="oof-size">
<i class="wi wi-day-cloudy wi-fw"></i> 81<i class="wi wi-fahrenheit"></i> / 48<i class="wi wi-fahrenheit"></i>
<i class="wi {{convertIconName dayWeather.icon}} wi-fw"></i> {{roundNumber dayWeather.temperatureMax}}<i class="wi wi-fahrenheit"></i> / {{roundNumber dayWeather.temperatureMin}}<i class="wi wi-fahrenheit"></i>
</div>
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--4-col">
<div class="out-of-focus-card mdl-card mdl-shadow--4dp">
<div class="mdl-card__title">
<h1 class="mdl-card__title-text">Saturday<br /></h1>
</div>
<div class="mdl-card__supporting-text">
<h5>Partly Cloudy</h5>
<div class="oof-size">
<i class="wi wi-day-cloudy wi-fw"></i> 83<i class="wi wi-fahrenheit"></i> / 48<i class="wi wi-fahrenheit"></i>
</div>
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--4-col">
<div class="out-of-focus-card mdl-card mdl-shadow--4dp">
<div class="mdl-card__title">
<h1 class="mdl-card__title-text">Sunday<br /></h1>
</div>
<div class="mdl-card__supporting-text">
<h5>Partly Cloudy</h5>
<div class="oof-size">
<i class="wi wi-day-cloudy wi-fw"></i> 78<i class="wi wi-fahrenheit"></i> / 48<i class="wi wi-fahrenheit"></i>
</div>
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--4-col">
<div class="out-of-focus-card mdl-card mdl-shadow--4dp">
<div class="mdl-card__title">
<h1 class="mdl-card__title-text">Monday<br /></h1>
</div>
<div class="mdl-card__supporting-text">
<h5>Partly Cloudy</h5>
<div class="oof-size">
<i class="wi wi-day-cloudy wi-fw"></i> 75<i class="wi wi-fahrenheit"></i> / 48<i class="wi wi-fahrenheit"></i>
</div>
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--4-col">
<div class="out-of-focus-card mdl-card mdl-shadow--4dp">
<div class="mdl-card__title">
<h1 class="mdl-card__title-text">Tuesday<br /></h1>
</div>
<div class="mdl-card__supporting-text">
<h5>Partly Cloudy</h5>
<div class="oof-size">
<i class="wi wi-day-cloudy wi-fw"></i> 72<i class="wi wi-fahrenheit"></i> / 48<i class="wi wi-fahrenheit"></i>
</div>
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--4-col">
<div class="out-of-focus-card mdl-card mdl-shadow--4dp">
<div class="mdl-card__title">
<h1 class="mdl-card__title-text">Wednesday<br /></h1>
</div>
<div class="mdl-card__supporting-text">
<h5>Partly Cloudy</h5>
<div class="oof-size">
<i class="wi wi-day-cloudy wi-fw"></i> 67<i class="wi wi-fahrenheit"></i> / 48<i class="wi wi-fahrenheit"></i>
<div class="detail-size">
<br />
{{precipitationWords dayWeather.precipProbability}}
<br /><br />
</div>
</div>
</div>
</div>
{{/each}}
</div>
</template>
......@@ -12,7 +12,7 @@ Template.weather.helpers({
if(precipProb === 0) return "No Rain Expected";
if(precipProb > 95) return "Bring an Umbrella";
if(precipProb > 100) return "Wat."; //Wait.
return precipProb+"%"; // Otherwise, return the percentage
return precipProb+"% Precipitation"; // Otherwise, return the percentage
},
//Converts degrees to words
windDirection: function() {
......@@ -83,6 +83,12 @@ Template.weather.helpers({
}
debugger;
return hourDataArray.slice(startIndex, startIndex+12)
},
getDayNameFromTime: function(timestamp) {
var given = new Date(timestamp);
var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
return days[ given.getDay() ];
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment