Bug 9993 - Some specific CultureInfo include wrong format of LongDatePattern
Summary: Some specific CultureInfo include wrong format of LongDatePattern
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 2.10.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-02-02 07:58 UTC by tome
Modified: 2013-02-04 13:42 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

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 GitHub or Developer Community 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:

Description tome 2013-02-02 07:58:03 UTC
There are some specific CultureInfo that include wrong format of LongDatePattern.
Precisely, two cultures "tr-TR", "eu-ES" are wrong and the formats are  'EEE' or 'EEEE'.
It seems like that the 'E' should be replaced with 'd' in .NET way.
Please see below test case

public void LongDatePatternTest ()
	var regex = new Regex ("E{2,4}", RegexOptions.Compiled);

	var wrongCultureInfos = (from ci in CultureInfo.GetCultures (CultureTypes.SpecificCultures)
	                         where regex.IsMatch (ci.DateTimeFormat.LongDatePattern)
	                         select ci
	                         ).ToList ();

//	Assert.AreEqual (0, wrongCultureInfos.Count); // oops

	var now = DateTime.Now;
	wrongCultureInfos.ForEach ((ci) => {
		var longDatePattern = ci.DateTimeFormat.LongDatePattern;
		Console.WriteLine ("[{0}] : {1} -> {2}", ci.Name, longDatePattern, now.ToString (longDatePattern, ci));

Output on my environment;
[tr-TR] : dd MMMM yyyy EEEE -> 02 Şubat 2013 EEEE
[eu-ES] : EEE, yyyy'eko' MMM'ren' dd'a' -> EEE, 2013eko otsren 02a
Comment 1 Marek Safar 2013-02-04 10:22:45 UTC
Already fixed in Mono 3.0
Comment 2 tome 2013-02-04 13:42:50 UTC
Do you have a plan to backport it to 2.10.x ?
Because I'm a MonoTouch user, so still couldn't get the benefit of 3.0.x.
Anyway not so critical for me.