fix grouping logic

master
root 2 years ago
parent 0a50822679
commit d0261bb713

@ -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;
}
}

Loading…
Cancel
Save