Bug 54645 - (Android) Time Picker ignores "use 24-h format" settings
Summary: (Android) Time Picker ignores "use 24-h format" settings
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jason Smith [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2017-04-06 15:00 UTC by Dmitijs Jesilevskis
Modified: 2017-08-29 10:38 UTC (History)
5 users (show)

Tags: android, timepicker, timeformat ac
Is this bug a regression?: ---
Last known good build:


Attachments
project (44.33 KB, application/x-zip-compressed)
2017-04-07 16:03 UTC, Jimmy [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Dmitijs Jesilevskis 2017-04-06 15:00:22 UTC
With release 2.3.4, a fix for Time Picker popup has been delivered to make sure Picker popup matches the 12h/24h settings of the Device: https://github.com/xamarin/Xamarin.Forms/pull/654.

Still there is inconsistency, in how editor displays (popup is closed) displays time.

Consider the following scenario:
1) Select Android device language with AM/PM culture (e.g. English (United States);
2) In Date and time settings of the device, enable "Use 24-hour format" setting;
3) Run the app with Time Picker.

Result:
* Editor (popup is closed) displays time in AM/PM format;
* Time Picker popup allows 24-h selection.

Expected:
When 24-hour format setting is enabled (and supported by selected device language):
* Editor displays time in 24-h format;
* Time Picker popup displays 24-h picker
When AM/PM format is enabled:
* Editor displays time in AM/PM format;
* Time Picker popup displays AM/PM picker

Suspected root cause:
With PR 654, popup now utilizes android's is24HourFormat() function that does the job as expected.
Editor text, uses standard ToString() function that relies on CurrentCulture (only selected device language) and does not know about "Use 24-hour format" setting.
Comment 1 Jimmy [MSFT] 2017-04-07 16:03:40 UTC
Created attachment 21336 [details]
project

I am seeing the issue described with the project I am attaching. 

While the picker itself matches the device's 24h setting, the Entry that displays the time selected only supports 12h. This means that if a user selects 16:00 in the picker, the Entry will display 4:00PM.


### Steps to Reproduce
1. Set the device to use 24hr time
2. Run the attached Android project
3. Select a time after 12:00
4. Press Okay


### Expected Results
The Entry will display the time selected


### Actual Results
The time in the Entry is converted to 12h 


### Version Tests
2.3.5.84    BAD
2.3.4.224   BAD
Comment 2 Jimmy [MSFT] 2017-08-17 15:58:59 UTC
https://github.com/xamarin/Xamarin.Forms/pull/1082
Comment 3 Rui Marinho 2017-08-29 10:38:18 UTC
Should be fixed on 2.4.1-pre1