This repository has been archived by the owner on May 1, 2024. It is now read-only.
[Bug] TimePicker posts 12-hour formatted value in the UI control when device setting is 24-hour format #14266
Labels
Projects
Description
Locale: en-AU
TimePicker.Format is not set (= default)
TimePicker picker/dialog respects device settings (24/12-hour format). However, when TimePicker posts value from the picker/dialog into the control, value appears in the 12-hour format regardless of the device setting.
It doesn't look like iOS ever worked but for Android it looks like Fix datetimepickerlocalization caused a regression of [Android] Use 24-hour time format on TimePicker text if enabled (#1082)
Suggestion
Make a default TimePicker.Format an empty value.
When TimePicker.Format is empty, check device settings for 12/24-hour format and use format accordingly.
Example for Android:
Xamarin.Forms/Xamarin.Forms.Platform.Android/Renderers/TimePickerRenderer.cs
Steps to Reproduce
Expected Behavior
Value posted into control is 17:00.
Actual Behavior
Value posted into control is 5:00 PM.
Basic Information
Environment
Show/Hide Visual Studio info
Build Logs
n/a
Screenshots
Reproduction Link
Xamarin-Forms-Samples
Workaround
Check the device 12/24-hour setting and assign "h:mm tt"/"HH:mm" value to TimePicker.Format.
The text was updated successfully, but these errors were encountered: