This is a migrated thread and some comments may be shown as answers.
Chart Date Axis - weeks
3 Answers 5 Views
This is a migrated thread and some comments may be shown as answers.
AP
Top achievements
Rank 1
AP asked on 04 Mar 2021, 09:48 AM

I have a chart with a date axis, set to show weeks. This works, but it is showing the month first, ignoring the UK culture setting. How can I set the weeks display to days first, then month?

 

Thanks

3 Answers, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 09 Mar 2021, 08:33 AM

Hi Andrew,

Thank you for the details provided.

In this case, the culture is not set at the server-side. In order to set the required culture globally, I would recommend trying one of the following:

  • Use the Globalization functionality and set the culture globally for the application. Here is an example:
    @using Kendo.Mvc.UI
    @using System.Globalization
    @{
        ViewData["Title"] = "Home Page";
        CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-GB");
    }
    
    
    <script src="https://kendo.cdn.telerik.com/2021.1.119/js/cultures/kendo.culture.en-GB.min.js"></script>
    <script type="text/javascript">
        kendo.culture("en-GB");
    </script>
  • Add the following in the "ConfigureServices" method in the Startup file:
    CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-GB")

Give a try to the approaches above and let me know if further assistance is needed.

Kind Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
AP
Top achievements
Rank 1
answered on 15 Mar 2021, 03:45 PM

Thanks for the reply, however I've already set the culture using the kendo.culture.en-GB.min.js file. A data picker shows the correct date, it's just the chart.

Also, I don't have a startup.cs in the application.

0
Anton Mironov
Telerik team
answered on 18 Mar 2021, 12:30 PM

Hello Andrew,

Thank you for the additional details provided. You are totally correct about the StartUp file.

I am trying to replicate the described behavior. Unfortunately without success for now. Are you using "kendo.toString" method? As it will override the default format of the application for the current field.

The fastest route to getting you up and running is if you could provide a runnable, isolated, sample project. Examining this project will let us replicate the issue locally and further troubleshoot it.

Looking forward to hearing back from you.

Best Regards,
Anton Mironov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Chart
Asked by
AP
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
AP
Top achievements
Rank 1
Share this question
or