F
Filamentβ€’3mo ago
adam

How can I add steps to the DateTime UI

minutesStep only works if you use the keyboard arrows to adjust the time. In V2 minutesStep controlled both the input and the UI.
No description
Solution:
In v3 it uses the default browser date time field, so to force the non native input field you have to explicitly tell it that.
Jump to solution
6 Replies
adam
adamβ€’3mo ago
No description
awcodes
awcodesβ€’2mo ago
Can you share the code for your field?
adam
adamβ€’2mo ago
Sure
TimePicker::make('from')
->seconds(false)
->minutesStep(config('global.minutes_step'))
->displayFormat(config('global.time_format'))
->required()
->reactive(),
TimePicker::make('from')
->seconds(false)
->minutesStep(config('global.minutes_step'))
->displayFormat(config('global.time_format'))
->required()
->reactive(),
In V2 I had used this 22 times and in all cases the UI is not stepped, validation asks me to change the input, but the keyboard input does step the time.
awcodes
awcodesβ€’2mo ago
Hmm, only thing I can think of is that between v2 and v3 the picker switch from native default false to true. So you might need to add ->native(false) to the field.
Solution
awcodes
awcodesβ€’2mo ago
In v3 it uses the default browser date time field, so to force the non native input field you have to explicitly tell it that.
adam
adamβ€’2mo ago
Ah, that was it! @awcodes Thanks other Adam πŸ™‚
Want results from more Discord servers?
Add your server