fix: correctly apply due dates for contract and invoice upload reminders

This commit is contained in:
Björn Fromme
2026-08-17 11:55:02 +02:00
parent 3e08965e48
commit 489aafed3e
22 changed files with 732 additions and 156 deletions
+5 -5
View File
@@ -8,7 +8,7 @@ use App\Entity\Teamer;
use App\Entity\Upload;
use App\Service\Teamer\PickupResolver;
use App\Service\Upload\UploadHandler;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment;
@@ -222,13 +222,13 @@ class AppRuntime implements RuntimeExtensionInterface
public function dateDiffForHumans(\DateTimeInterface $dateTime, ?\DateTimeInterface $other = null): string
{
$oldLocale = Carbon::getLocale();
$oldLocale = CarbonImmutable::getLocale();
$locale = $this->requestStack->getMainRequest()->getLocale();
Carbon::setLocale($locale);
CarbonImmutable::setLocale($locale);
$result = Carbon::instance($dateTime)->diffForHumans($other);
$result = CarbonImmutable::instance($dateTime)->diffForHumans($other);
Carbon::setLocale($oldLocale);
CarbonImmutable::setLocale($oldLocale);
return $result;
}