F
Filament11mo ago
Quin.

SelectColumn with carbon

Hello! If i click on the previous or next month it shows that it goes 2 months back or forward but it saves as 1 month back or forward. can anyone tell me how i fix that it will only shows 1 month forward of backwards
SelectColumn::make('invoice_month')
->options(function (Invoice $record) {[
$previousMonth = Carbon::parse($record->invoice_month)->subMonth()->format('Y-m'),
$currentMonth = Carbon::parse($record->invoice_month)->format('Y-m'),
$nextMonth = Carbon::parse($record->invoice_month)->addMonth()->format('Y-m')
];
return [
$previousMonth => $previousMonth,
$currentMonth => $currentMonth,
$nextMonth => $nextMonth,
];
}),
SelectColumn::make('invoice_month')
->options(function (Invoice $record) {[
$previousMonth = Carbon::parse($record->invoice_month)->subMonth()->format('Y-m'),
$currentMonth = Carbon::parse($record->invoice_month)->format('Y-m'),
$nextMonth = Carbon::parse($record->invoice_month)->addMonth()->format('Y-m')
];
return [
$previousMonth => $previousMonth,
$currentMonth => $currentMonth,
$nextMonth => $nextMonth,
];
}),
1 Reply
Quin.
Quin.OP11mo ago
anyone?
Want results from more Discord servers?
Add your server