Xamarin.forms: [Arabic] Hijri date shown on DatePicker while the popup selector shows Gregorian dates

Created on 6 Jul 2018  ·  5Comments  ·  Source: xamarin/Xamarin.Forms

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

  • Version with issue: Xamarin.Forms v3.1.0.583944
  • Last known good version: -
  • IDE: Visual Studio 15.7.4
  • Platform Target Frameworks:

    • iOS: 11.4

    • Android: 8.0

    • UWP: Untested

  • Android Support Library Version: v7
  • Nuget Packages:
  • Affected Devices:
l10n 6 help wanted inactive Android iOS 🍎 needs-info ❓ bug up-for-grabs

All 5 comments

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

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"

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!

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.

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

Was this page helpful?
0 / 5 - 0 ratings