fix first week in year shows wrong year (#2239)

This commit is contained in:
Kevin Papst
2021-01-08 15:12:42 +01:00
committed by GitHub
parent 244169d6d5
commit 1aae4f4d0f
2 changed files with 5 additions and 5 deletions

View File

@@ -51,7 +51,7 @@ class DateTimeFactory
$date = $this->createDateTime('now');
}
return $this->createWeekDateTime($date->format('Y'), $date->format('W'), 1, 0, 0, 0);
return $this->createWeekDateTime($date->format('o'), $date->format('W'), 1, 0, 0, 0);
}
public function getEndOfWeek(?DateTime $date = null): DateTime
@@ -60,7 +60,7 @@ class DateTimeFactory
$date = $this->createDateTime('now');
}
return $this->createWeekDateTime($date->format('Y'), $date->format('W'), 7, 23, 59, 59);
return $this->createWeekDateTime($date->format('o'), $date->format('W'), 7, 23, 59, 59);
}
public function getEndOfMonth(): DateTime