344
Views
1
Comments
Time input with "PM/AM" in some browsers/computers
Question

Hello,


I'm having some issues with a time input.

In some browsers/computers, the time input is be shown like the following, where the AM/PM is not visible.

In my situation, for example, in Firefox, the input has the PM:

I know this is due to configurations in the browser/computer but how can we overcome this? Because I have a 24h format in my time and it looks really weird being: 14:00 PM.


I already tried to this:

input[type=time]::-webkit-datetime-edit-ampm-field{

  color: transparent;} 


or even this:

input[type=time]::datetime-edit-field{

    display: none !important;

}

input[type=time]::datetime-edit-field.numeric{

    display: inline !important;

}


I noticed that in firefox, the PM is on a span.datetime-edit-field but I already tried to change this class but nothing works


Thank you in advance

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Carolina,

If the browser displays AM/PM, this means that the user of that browser has set a locale that indicates they want to use AM/PM instead of 24h format. Overriding this is not beneficial for the user! See here for more details.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.