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.feat/granted-plans
parent
33e5b15099
commit
b5de002622
|
|
@ -68,7 +68,10 @@ class Invoices extends Component
|
||||||
'years' => Invoice::query()
|
'years' => Invoice::query()
|
||||||
->orderByDesc('issued_on')
|
->orderByDesc('issued_on')
|
||||||
->pluck('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()
|
->filter()
|
||||||
->unique()
|
->unique()
|
||||||
->values(),
|
->values(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue