Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimePicker Displays AM/PM Text in Different Languages with hh:mm tt Format on .NET 9 SDK (iOS Only) #26885

Closed
NiravTyler opened this issue Dec 31, 2024 · 1 comment
Labels
t/bug Something isn't working

Comments

@NiravTyler
Copy link

Description

Here’s the reformatted version:
Issue Description: AM/PM Text in TimePicker Control on iOS

When using the hh:mm tt format for the TimePicker control in a .NET MAUI application, the AM/PM text appears randomly in different languages after selecting a value from the picker.

Affected Platform: iOS
SDK Versions:
    .NET 8 SDK: Working as expected
    .NET 9 SDK: AM/PM text issue present

Reference Videos

.NET 8 SDK (Working Fine):
Time.picker.with.NET.8.SDK.working.fine.mp4
.NET 9 SDK (AM/PM Text Issue):

https://drive.google.com/file/d/1ow8Y4VGr_2sHRwEr8NzkloaC5CboLkI_/view?usp=sharing

Steps to Reproduce

Steps to Reproduce the Issue with the .NET MAUI TimePicker Control

Clone the MAUI Samples Repository:
Download the maui-samples repository using the following link:
https://github.com/dotnet/maui-samples.git

Open the ControlGallery Solution:
Navigate to the following path in the cloned repository:
9.0/UserInterface/ControlGallery
Open the ControlGallery solution in your preferred IDE (e.g., Visual Studio).

Locate the TimePicker Demo File:
Open the TimePickerDemoPage.xaml file located at:
[ControlGallery/Views/XAML/TimePickerDemoPage.xaml](https://github.com/dotnet/maui-samples/blob/main/9.0/UserInterface/ControlGallery/ControlGallery/Views/XAML/TimePickerDemoPage.xaml)

Modify the TimePicker Control:
Add the following code snippet to the TimePicker control in TimePickerDemoPage.xaml:

<TimePicker
    x:Name="TimePickerControl"
    Format="hh:mm tt"
    VerticalOptions="CenterAndExpand"
    Margin="10, 0" />

Run the Application in iOS Simulator:
Build and run the project using the iOS simulator.
Observe the issue related to the AM/PM text display as shown in the video linked below.

Issue Details

SDK Version: .NET 9
Description: The TimePicker control has an issue with the display of AM/PM text in the iOS simulator.
Reference Video:
AM/PM Display Issue

Time picker with .NET 9 SDK (having an issue with AM/PM text) video link:
https://drive.google.com/file/d/1ow8Y4VGr_2sHRwEr8NzkloaC5CboLkI_/view?usp=sharing

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/9.0

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.100 SR10

Affected platforms

iOS

Affected platform versions

iOS 17, 18

Did you find any workaround?

No, I did not found any solution yet.

I tried to set TimeFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern for Timepicket format and also set CultureInfo to (en-US) for the sample app but still not working.

Relevant log output

@NiravTyler NiravTyler added the t/bug Something isn't working label Dec 31, 2024
@jfversluis
Copy link
Member

Probably related to/duplicate of dotnet/runtime#110680

@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants