Skip to content

Commit

Permalink
fix: date display if last day of month if sunday
Browse files Browse the repository at this point in the history
  • Loading branch information
dehy committed Feb 11, 2024
1 parent a1b6d49 commit 1e1e725
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controller/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function index(Request $request, EventRepository $eventRepository): Respo
->findForLicenseeByMonthAndYear($this->licenseeHelper->getLicenseeFromSession(), $month, $year);

$firstDate = (new \DateTime(sprintf('%s-%s-01 midnight', $year, $month)));
$lastDate = (clone $firstDate)->modify('last day of this month');
$lastDate = (clone $firstDate)->modify('last day of this month')->setTime(23, 59, 59);
if (1 !== (int) $firstDate->format('N')) {
$firstDate->modify('previous monday');
}
Expand Down

0 comments on commit 1e1e725

Please sign in to comment.