Take the invoice year off the storage clock too
tests / pest (push) Failing after 7m40s Details
tests / assets (push) Successful in 23s Details
tests / release (push) Has been skipped Details

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.
feat/granted-plans
nexxo 2026-07-29 02:28:34 +02:00
parent 33e5b15099
commit b5de002622
1 changed files with 4 additions and 1 deletions

View File

@ -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(),