Bug 4708 - ShortDatePattern and Russian locale
Summary: ShortDatePattern and Russian locale
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on: 4782
Blocks:
  Show dependency tree
 
Reported: 2012-04-28 07:01 UTC by Maxim
Modified: 2012-07-18 12:37 UTC (History)
4 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Maxim 2012-04-28 07:01:37 UTC
I'm tring to change default date format in whole app.

I'm using code:
            CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
            culture.DateTimeFormat.ShortDatePattern = "d MMMM yyyy";
            Thread.CurrentThread.CurrentCulture = culture;

I'm expecting to get
"28 апреля 2012", but it prints
"28 Апрель 2012".

So it utilize generic month name, not culture specified value (declination of the words).

Same with LongDatePattern. Same under latest stable Mono for Android.


I already know that we could replace culture.DateTimeFormat.MonthNames array with prepared values.
Comment 1 Maxim 2012-04-28 07:58:42 UTC
See example at http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.longdatepattern.aspx

Mono returns
"ru-RU   d MMMM yyyy 'г.'     12 Ноябрь 2001 г."
instead of
"ru-RU   d MMMM yyyy 'г.'     12 ноября 2011 г
Comment 2 Marek Safar 2012-05-15 13:37:37 UTC
Fixed in master
Comment 3 Maxim 2012-07-18 10:19:11 UTC
I'm sorry, It's not fixed.

When using latest stable Mono+MonoTouch run this code:
  CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
  culture.DateTimeFormat.ShortDatePattern = "d MMMM yyyy";
  Thread.CurrentThread.CurrentCulture = culture;
  Console.WriteLine(DateTime.Now.ToShortDateString());

I'm expecting to get "18 июля 2012" under Russian locale,
but it prints "18 Июль 2012".
Comment 4 Marek Safar 2012-07-18 10:22:25 UTC
it has been fixed in mono master not monotouch, you need to wait for monotouch to start using mono 2.11
Comment 5 Rolf Bjarne Kvinge [MSFT] 2012-07-18 11:20:25 UTC
MonoTouch will likely switch to use Mono 2.11/2.12 some time later this year.
Comment 6 Maxim 2012-07-18 12:37:22 UTC
Oh, thanks you for info!