From d0261bb7138906ed162ecad4cba995792ae0fb59 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Jul 2022 17:03:26 +0200 Subject: [PATCH] fix grouping logic --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index f670d2b..60ada8d 100644 --- a/index.php +++ b/index.php @@ -74,7 +74,7 @@ foreach ($data->list as $line) { $rainArr = (array) ($line->rain ?? []); $snowArr = (array) ($line->snow ?? []); $rain = ($rainArr['3h'] ?? 0) + ($snowArr['3h'] ?? 0); - + $wind = $line->wind->speed; $flying = $rain === 0 && $wind < 2.5 ? 'Y' : $rain <= 0.3 && $wind < 3.1 ? 'M' @@ -112,7 +112,7 @@ foreach($list as $line) { $dayGroup[] = $line; } else { $grouped[] = $dayGroup; - $dayGroup = []; + $dayGroup = [$line]; $lastDay = $dayStr; } }