Imported Upstream version 5.18.0.143

Former-commit-id: 190bf917c45411b544adb921dd8c87b0b168f852
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-10 08:55:35 +00:00
parent 0abdbe5a7d
commit 919135da16
46 changed files with 42 additions and 39 deletions

View File

@@ -633,10 +633,13 @@ namespace System.Security.Cryptography.X509Certificates
if (!culture.DateTimeFormat.Calendar.IsValidDay (date.Year, date.Month, date.Day, 0)) {
// The most common case of culture failing to work is in the Um-AlQuara calendar. In this case,
// we can fall back to the Hijri calendar, otherwise fall back to the invariant culture.
#if !MOBILE
if (culture.DateTimeFormat.Calendar is UmAlQuraCalendar) {
culture = culture.Clone () as CultureInfo;
culture.DateTimeFormat.Calendar = new HijriCalendar ();
} else {
} else
#endif
{
culture = CultureInfo.InvariantCulture;
}
}