Datepicker time does not keep change to AM when choosing 12 as the hour #831

Closed
opened 2026-01-29 17:45:03 +00:00 by claunia · 1 comment
Owner

Originally created by @rachelsutherland on GitHub (Apr 27, 2023).

Describe the bug
When changing time on the date picker to 12:00 AM, the AM does not stay and changes to PM in the input area. You have to manually change it to "AM". This seems to be because if you change from an "AM" time to 12:00, the calendar will automatically change it to "PM" assuming that is the intended time. That behavior is fine, but if the user uses the arrow to then change it to "AM", that input should stick.

To Reproduce
Steps to reproduce the behavior:

  1. You can see this behavior on the "Define hour format" section of the Blazor examples: https://blazor.radzen.com/datepicker
  2. Click on the Datepicker and change the hour to 12 and change it to "AM"
  3. Click "OK"
  4. Time in text input will be "PM"

Expected behavior
If the time is changed to "AM", the text input and data value should be "AM", not "PM"

Originally created by @rachelsutherland on GitHub (Apr 27, 2023). **Describe the bug** When changing time on the date picker to 12:00 AM, the AM does not stay and changes to PM in the input area. You have to manually change it to "AM". This seems to be because if you change from an "AM" time to 12:00, the calendar will automatically change it to "PM" assuming that is the intended time. That behavior is fine, but if the user uses the arrow to then change it to "AM", that input should stick. **To Reproduce** Steps to reproduce the behavior: 1. You can see this behavior on the "Define hour format" section of the Blazor examples: https://blazor.radzen.com/datepicker 2. Click on the Datepicker and change the hour to 12 and change it to "AM" 3. Click "OK" 4. Time in text input will be "PM" **Expected behavior** If the time is changed to "AM", the text input and data value should be "AM", not "PM"
Author
Owner

@enchev commented on GitHub (Apr 28, 2023):

Here is the method that toggles AM/PM. If you feel there is a bug or you know better approach feel free to submit pull request.

@enchev commented on GitHub (Apr 28, 2023): [Here is the method](https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/RadzenDatePicker.razor.cs#L29-L57) that toggles AM/PM. If you feel there is a bug or you know better approach feel free to submit pull request.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#831