fix sunday being first day of week (#2483)

This commit is contained in:
Kevin Papst
2021-04-19 18:32:21 +02:00
committed by GitHub
parent b6462b406d
commit 7ddcde62dd
17 changed files with 136 additions and 71 deletions

View File

@@ -294,12 +294,14 @@ final class ServiceInvoice
private function getDateTimeFactory(InvoiceQuery $query): DateTimeFactory
{
$timezone = date_default_timezone_get();
$sunday = false;
if (null !== $query->getCurrentUser()) {
$timezone = $query->getCurrentUser()->getTimezone();
if (null !== ($user = $query->getCurrentUser())) {
$timezone = $user->getTimezone();
$sunday = $user->isFirstDayOfWeekSunday();
}
return new DateTimeFactory(new \DateTimeZone($timezone));
return new DateTimeFactory(new \DateTimeZone($timezone), $sunday);
}
/**