TimePicker field not allow to set 24 hrs format.

TimePicker::make('picker')->displayFormat('H:i'),
TimePicker::make('picker')->displayFormat('H:i'),
I tried this but the it not allow to me set 13 for 1 PM, When I type 13 it turn into 1.
8 Replies
dissto
dissto7mo ago
Can you not just pass ->seconds(false) to make it hour format?
TimePicker::make('picker')->displayFormat('H:i')
->seconds(false),
TimePicker::make('picker')->displayFormat('H:i')
->seconds(false),
Probably also saver to use native(false)
dissto
dissto7mo ago
No description
Dan Harrin
Dan Harrin7mo ago
its the native browser time input if you dont want the native browser one you can use the 24 hour js one with ->native(false)
Tazeen
Tazeen4mo ago
How did you get the 12 hrs. format by default? I am getting 24 hrs. format and am trying to set 12 hrs. format but it does not seem to work. I am using the below code... Any help would be much appreciated. TimePicker::make('endTime') ->label('End Time') ->withoutSeconds() ->required() ->format('h:i A')
Dennis Koch
Dennis Koch4mo ago
The last answer from Dan explained it. Did you read it?
Tazeen
Tazeen4mo ago
Yes I read it. I am not using native(false) in my code, so according to the answer I should be getting the 12 hr format right? But still I am getting the 24 hrs format itself.
Tazeen
Tazeen4mo ago
No description
Dennis Koch
Dennis Koch4mo ago
I am not using native(false)
The last answer said you should use exactly that, because the native picker uses your browser settings.
Want results from more Discord servers?
Add your server