savannabits / filament-flatpickr

Extend your Filament Date-Picking with Flatpickr
MIT License
43 stars 29 forks source link

[Bug]: defaultDate for Range datepicker #38

Open ucosatti opened 10 months ago

ucosatti commented 10 months ago

What happened?

I'm trying to use a range datepicker for a form, but when I pass a value (an array of 2 dates, as it mention in Flatpickr docs) it doesn't show anything. The array is a attribute in the model joining to date fields.

Is it a bug or I'm doing something wrong?

How to reproduce the bug

.

Package Version

3

PHP Version

8.1

Laravel Version

10

Which operating systems does with happen with?

macOS

Notes

No response

markpavia commented 9 months ago

for the meantime I used this

->formatStateUsing(function (string $state): string {
                                [$from, $to] = json_decode($state);

                                return "$from to $to";
                            })