Language of datetimeformat

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Language of datetimeformat

Post by acastro » Wed May 28, 2014 12:34 pm

When you set the property
chart.Axes.Bottom.Labels.DateTimeFormat = "dddd"
In my computer the day of the week is shown in spanish. I would like to configurate the language of my application in my application. Where take teechart the language from?

Thanks

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Language of datetimeformat

Post by Christopher » Wed May 28, 2014 1:36 pm

wakeup wrote:When you set the property
chart.Axes.Bottom.Labels.DateTimeFormat = "dddd"
In my computer the day of the week is shown in spanish. I would like to configurate the language of my application in my application. Where take teechart the language from?
Following the MSDN documentation for DateTime.ToString method, you can use:

Code: Select all

    private void button1_Click(object sender, EventArgs e)
    {
      Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
      MessageBox.Show(DateTime.Today.ToString("dddd"));
    }
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Language of datetimeformat

Post by acastro » Wed May 28, 2014 1:39 pm

The instruction for giving to teechart the time format is chart.Axes.Bottom.Labels.DateTimeFormat = "dddd" , not "toString" possibility here...

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Language of datetimeformat

Post by Christopher » Wed May 28, 2014 1:54 pm

wakeup wrote:The instruction for giving to teechart the time format is chart.Axes.Bottom.Labels.DateTimeFormat = "dddd" , not "toString" possibility here...
Have you tried adding the line:

Code: Select all

Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("fr-FR");
before the line:

Code: Select all

chart.Axes.Bottom.Labels.DateTimeFormat = "dddd"
in your code?
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

acastro
Advanced
Posts: 204
Joined: Tue Oct 27, 2009 12:00 am

Re: Language of datetimeformat

Post by acastro » Thu May 29, 2014 6:32 am

Thanks, it runs, but this change does also other changes in the application like change the decimal separator, in the numeric fileds of the applicaion. Is not possible only to change the language of the datetime format?

Thanks

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Language of datetimeformat

Post by Christopher » Thu May 29, 2014 7:23 am

wakeup wrote:Thanks, it runs, but this change does also other changes in the application like change the decimal separator, in the numeric fileds of the applicaion. Is not possible only to change the language of the datetime format?
This is not a TeeChart issue, but a .NET Framework issue. As far as I know, changing the CurrentCulture is the only way to change the language the .NET Framework uses to display DateTime values.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply