fix Navigation.php MTD logic to make tests pass.

This commit is contained in:
tasnim 2024-08-26 16:06:58 +03:00
parent b8e18f80f4
commit 63012f269c

View File

@ -283,13 +283,10 @@ class Navigation
return $currentEnd;
}
if ('MTD' === $repeatFreq) {
$today = today();
if ($today->isSameMonth($end)) {
return $today->endOfDay();
}
return $end->endOfMonth();
return $end->startOfMonth()->startOfDay();
}
$result = match ($repeatFreq) {
'last7' => $currentEnd->addDays(7)->startOfDay(),