Month and Year
For Card payment i want just month and year i dont want date
is there a way ??
11 Replies
i want to hide the dates
i just want month and year
Did you try to play with the format function?
yes
DatePicker::make('ExpiryDate')->format('m/y')
->disabledDates(function () {
$start = Carbon::now()->addMonth()->startOfMonth();
$end = $start->copy()->addMonth()->endOfMonth();
$period = CarbonPeriod::create($start, $end);
$weekends = []; foreach ($period as $date) { if ($date->isWeekend()) { $weekends[] = $date->format('Y-m-d'); } }
return $weekends; }) ->label('Expiry Date') ->placeholder('mm/yy') ->required(),
$weekends = []; foreach ($period as $date) { if ($date->isWeekend()) { $weekends[] = $date->format('Y-m-d'); } }
return $weekends; }) ->label('Expiry Date') ->placeholder('mm/yy') ->required(),
Why are you using DatePicker for this
you just want month and. year
https://filamentphp.com/plugins/coolsam-flatpickr
got this but not able to install in V2
Filament
Flatpickr by Sam Maosa - Filament
Use Flatpickr as your datepicker in the Filament Forms and Panels
yes
So you're using v2?
yes
Flapickr has a v2 version as well
yes but it show Asset not found while installing
may be iam missing something.......
checking now....
GitHub
GitHub - savannabits/filament-flatpickr at main
Extend your Filament Date-Picking with Flatpickr. Contribute to savannabits/filament-flatpickr development by creating an account on GitHub.