This commit is contained in:
James Cole 2023-03-05 07:59:48 +01:00
parent 1539dcffd5
commit 57b83dd239
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -204,6 +204,21 @@ class Navigation
return $date;
}
$result = match ($repeatFreq) {
'last7' => $date->subDays(7)->startOfDay(),
'last30' => $date->subDays(30)->startOfDay(),
'last90' => $date->subDays(90)->startOfDay(),
'last365' => $date->subDays(365)->startOfDay(),
'MTD' => $date->startOfMonth()->startOfDay(),
'QTD' => $date->firstOfQuarter()->startOfDay(),
'YTD' => $date->startOfYear()->startOfDay(),
default => null,
};
if (null !== $result) {
return $result;
}
if ('custom' === $repeatFreq) {
return $date; // the date is already at the start.
}