This commit is contained in:
Sander Dorigo
2025-10-02 10:15:18 +02:00
parent 8885d1dbeb
commit 3f81aa7403
2 changed files with 11 additions and 0 deletions

View File

@@ -46,6 +46,16 @@ class DateRequest extends FormRequest
{
$start = $this->getCarbonDate('start');
$end = $this->getCarbonDate('end');
if(null === $start) {
$start = now()->startOfMonth();
}
if(null === $end) {
$end = now()->endOfMonth();
}
// sanity check on dates:
[$start, $end] = $end < $start ? [$end, $start] : [$start, $end];
$start->startOfDay();
$end->endOfDay();
if ($start->diffInYears($end, true) > 5) {