xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.64k stars 1.88k forks source link

[Arabic] Hijri date shown on DatePicker while the popup selector shows Gregorian dates #3229

Closed primehalo closed 3 years ago

primehalo commented 6 years ago

Description

When the app's culture is set to Arabic the date shown on a DatePicker is in the Hijri calendar rather than the Gregorian calendar despite Gregorian dates being shown when the DatePicker is actually opened. There is seemingly no way to force the DatePicker to show the Gregorian date. My workaround was go make a custom DatePicker so I could change Control.Text = date.ToString(Element.Format) to Control.Text = date.ToString(Element.Format, new System.Globalization.CultureInfo("en")). It'd be really nice if we could just set the culture of the DatePicker.

Steps to Reproduce

  1. Set the culture to Arabic
  2. Add a DatePicker to a page
  3. The date in the DatePicker will show as Hijri
  4. Tap on the DatePicker and see a Gregorian calendar in Android or a Picker of Gregorian dates in iOS.

Expected Behavior

I would expect the date shown in the date picker to match the dates shown when the picker is open.

Actual Behavior

The DatePicker shows a Hijri date but Gregorian dates are shown when presented with the dates to pick from.

Basic Information

hartez commented 6 years ago

It may be that we need to correctly set the locale or calendar for the UIDatePicker.

yahiaalnaqeeb commented 4 years ago

any solution for these issues "Specified time is not supported in this calendar. It should be between 04/30/1900 00:00:00 (Gregorian date) and 11/16/2077 23:59:59 (Gregorian date), inclusive.\nParameter name: time"

samhouts commented 3 years ago

This issue doesn't seem to have had any activity in a long time. We're working on prioritizing issues and resolving them as quickly as we can. To help us get through the list, we would appreciate an update from you to let us know if this is still affecting you on the latest version of Xamarin.Forms, since it's possible that we may have resolved this as part of another related or duplicate issue. If we don't see any new activity on this issue in the next 30 days, we'll evaluate whether this issue should be closed. Thank you!

primehalo commented 3 years ago

I haven't attempted to use the datepicker since I wrote my workaround which was over a couple years ago so I have no idea if it has been fixed yet.

samhouts commented 3 years ago

Thanks, I'll keep this open a bit longer to see if there is any further feedback.

Redth commented 3 years ago

Since we haven't heard from you in more than 30 days, we hope this issue is no longer affecting you. If it is, please reopen this issue and provide the requested information so that we can look into it further. Thank you!