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
adamOPβ€’3mo ago
No description
awcodes
awcodesβ€’3mo ago
Can you share the code for your field?
adam
adamOPβ€’3mo 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β€’3mo 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β€’3mo 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
adamOPβ€’3mo ago
Ah, that was it! @awcodes Thanks other Adam πŸ™‚
Want results from more Discord servers?
Add your server