From 3398dd3695086bc7e6ce44ea9519d183b4252378 Mon Sep 17 00:00:00 2001 From: ryan Date: Sat, 18 Mar 2023 15:33:19 +0000 Subject: [PATCH] added hour blocks --- WeatherDashboard.Web/Views/Home/Index.cshtml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/WeatherDashboard.Web/Views/Home/Index.cshtml b/WeatherDashboard.Web/Views/Home/Index.cshtml index 9b913a4..468d741 100644 --- a/WeatherDashboard.Web/Views/Home/Index.cshtml +++ b/WeatherDashboard.Web/Views/Home/Index.cshtml @@ -17,12 +17,18 @@ @foreach (var forecast in Model.Forecast) { + var displayHours = new[] { 6, 11, 15, 22 }; + + var hourForecasts = forecast.HourForecasts + .Where(f => displayHours.Contains(f.Time.Value.Hour)) + .ToList(); +
@forecast.Summary.ConditionName
@forecast.Summary.HighTemp / @forecast.Summary.LowTemp
- @foreach (var hourForecast in forecast.HourForecasts) + @foreach (var hourForecast in hourForecasts) {
@hourForecast.Time