question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting [format]="24" will hide the "AM/PM" from the UI but won't actually use 24 hour format

See original GitHub issue
<mat-form-field>
  <input matInput name="interview_time" [(ngModel)]="input.interview_time" placeholder="Time" [ngxTimepicker]="interview_time" [format]="24">
  <ngx-material-timepicker #interview_time></ngx-material-timepicker>
</mat-form-field>

Expected result:

Setting 11:30 PM using the timepicker UI would set the value of the <input> to 23:30 on the UI.

Actual result:

Setting 11:30 PM using the timepicker UI sets the value of the <input> to 11:30 on the UI. It simply removes the “am/pm” part, making it impossible for the user to tell the difference between them afterwards.

Notes:

It correctly sets the ngModel to string 11:30 PM in both cases.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Agranomcommented, Jul 10, 2018

I try it with two way binding and it works fine. <input placeholder="24hr format" aria-label="24hr format" [ngxTimepicker]="fullTime" [format]="24" [(ngModel)]="test" readonly> <ngx-material-timepicker #fullTime></ngx-material-timepicker> What does the input mean in your input.interview_time? Is that just object or a form control?

1reaction
Agranomcommented, Jul 10, 2018

I’ll resolve it in 30 min

Read more comments on GitHub >

github_iconTop Results From Across the Web

Big Sur doesn't allow me to change date/time format in menu bar
Go to Settings > Dock & Menu Bar > Clock and untick "Use a 24-hour clock", and enable "Show AM/PM" if you want....
Read more >
How to change material-ui timepicker to 24 hour format
I would like to have my picker with a 24-hour format which would remove the AM/PM option. I've looked in the material-ui documentation...
Read more >
Is there a way to switch to 24 hour time format instead of AM ...
Yes, you can achieve that either by manually typing the time-range with the 24-hour version in the time-range box or select the custom......
Read more >
How to Remove AM/PM from Time in Excel - YouTube
... file here: https://www.bluepecantraining.com/how-to- remove - am-pm -from- time -in-excel- format - time -as-duration-elapsed- time - format /In this.
Read more >
Galaxy S21/Ultra/Plus: How to Set Clock to Use 24 ... - YouTube
Learn how you can set the clock to use 24 hour format or AM/PM format on the Galaxy S21/Ultra/Plus.Gears I use :Velbon Sherpa...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found