0

I have used HTML input type "time" with angular material 2. The format of this field is based on system time format but I want to display only 24 hours formats in the time field.

How can I do that? Please guide.

Mohit Saxena
  • 1,439
  • 1
  • 12
  • 21

1 Answers1

0

You are missing code examples for better understanding.

But if I understood correctly, you need to add date pipes, as described on the Angular Documentation

Example: {{dateSelected | date: 'shortTime'}}

Rafael Gil
  • 151
  • 3
  • We have time input field. Example: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_time Here I need 24 hours format. – Mohit Saxena Nov 23 '17 at 05:06
  • What is it showing on the field? Can you post your code, the result and the expected result? – Rafael Gil Nov 23 '17 at 15:18
  • It depends on the browser. Some browsers support 24 hours by default, some don't: https://stackoverflow.com/a/13523302/6782707 – Edric Nov 24 '17 at 07:41
  • As an alternative, you can put a text field and a mask for it with it own rules – Rafael Gil Nov 24 '17 at 15:49