From b5de002622f54f843fbd5a28e67f254ecb5dcf20 Mon Sep 17 00:00:00 2001 From: nexxo Date: Wed, 29 Jul 2026 02:28:34 +0200 Subject: [PATCH] Take the invoice year off the storage clock too DisplayTimezoneTest went red on main: the year filter formatted issued_on without ->local(). A year looks timezone-proof until New Year's night, when the UTC year is still the previous one and the filter offers a year the operator has already left. R19 is absolute for exactly that reason. --- app/Livewire/Admin/Invoices.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Livewire/Admin/Invoices.php b/app/Livewire/Admin/Invoices.php index 128f1d4..6c18f2e 100644 --- a/app/Livewire/Admin/Invoices.php +++ b/app/Livewire/Admin/Invoices.php @@ -68,7 +68,10 @@ class Invoices extends Component 'years' => Invoice::query() ->orderByDesc('issued_on') ->pluck('issued_on') - ->map(fn ($date) => $date?->format('Y')) + // ->local() even for a year (R19): on New Year's night the UTC + // year is still the previous one, so the filter would offer a + // year the operator is no longer in. + ->map(fn ($date) => $date?->local()->format('Y')) ->filter() ->unique() ->values(),