diff --git a/Classes/Domain/Repository/PostRepository.php b/Classes/Domain/Repository/PostRepository.php index 2925dd6a..a4436d34 100644 --- a/Classes/Domain/Repository/PostRepository.php +++ b/Classes/Domain/Repository/PostRepository.php @@ -207,7 +207,7 @@ public function findByMonthAndYear(int $year, int $month = null) $startDate = new \DateTimeImmutable(sprintf('%d-%d-1 00:00:00', $year, $month)); $endDate = new \DateTimeImmutable(sprintf('%d-%d-%d 23:59:59', $year, $month, (int)$startDate->format('t'))); } else { - $startDate = new \DateTimeImmutable(sprintf('%d-1-1 00:00:00', $month)); + $startDate = new \DateTimeImmutable(sprintf('%d-1-1 00:00:00', $year)); $endDate = new \DateTimeImmutable(sprintf('%d-12-31 23:59:59', $year)); } $constraints[] = $query->greaterThanOrEqual('publish_date', $startDate->getTimestamp());