TimeEntry restricted to 24h format
How can I ensure the time-entry input is only rendered in 24h (ie no AM/PM options)?
14 Replies
use time picker?
TimePicker::make('alarm_at')
I think you just want to change the
displayFormat()
?I've tried using that but maybe don't understand exactly how to leverage the formatting.
I get this with
But am trying to get the first list to be 0-24, and hide the AM/PM selection. Even better if I can hide the seconds but thats not huge if not.
Shouldn't
H:i
do this?
you need to use native(false)
your browser doesnt have that control for am/pm
is documented how to change am/pm into 24h,
TimerPicker
& DateTimePicker
?its just the native browser behaviour not filament
if you want to turn off the native browser behaviour you need to use native(false) as i said. the method is documented
or maybe there is a browser/os setting, google it
This is new knowledge for me. Thanks for the information.
Can you make documentation about it, how to make it 24h instead of 12h AM|PM?
So that this question is not repeated.
i also dont get why someone would disable am/pm input if that is what their current locale uses
each locale on your OS has a different preference for that
I guess being in one country as a developer building something for an audience in another country. You demo something, client says “No am/pm!” and then you start searching as you’re not familiar with native inputs (this is all going off assumptions). Anyway, I think this less of an issue for US/UK devs building for their own local audiences.
on the other hand, I dont want to worry about where my user is based
some of my users might want am/pm, some might not
so again I don't want to control that for them 🤷♂️
I’m with you here. Just trying to come up with an explanation
I do sometimes like to make it an app setting for the user and stick to that instead of relying on the locale.
Especially with like expat employees etc. Again very dependent on the audience.
Maybe ask the user to test it or set your browser locale to the country the app is being developed for?
follow-up on this - we were able to convince the client to accept the am/pm as a 'device and locale' standard (as you suggested) - very much appreciated!