malzariey / filament-daterangepicker-filter

MIT License
105 stars 46 forks source link

feat: add multiple configurable options #3

Closed kenng closed 1 year ago

kenng commented 1 year ago

Sample usage

                DateRangePicker::make('StartAndEndDate')
                    ->setTimePickerOption(true)
                    ->setTimePickerIncrementOption(2)
                    ->setLinkedCalendarsOption(true)
                    ->label('Event Date (start to end)')
                    ->displayFormat('YYYY-MM-DD(HH:mm)')
                    ->formatStateUsing(function ($record) {
                        $start = Carbon::parse($record['StartTime']);
                        $end = Carbon::parse($record['EndTime']);
                        return $start->format('Y-m-d(H:i)') . " - " . $end->format('Y-m-d(H:i)');
                    }),
malzariey commented 1 year ago

is formatStateUsing connected to the value, I believe we need to send a callback to JavaScript.