This is a migrated thread and some comments may be shown as answers.

Localization is ignored in Yearview

2 Answers 50 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Petr
Top achievements
Rank 1
Iron
Petr asked on 02 Apr 2020, 09:31 AM

Hi all,

I started to use Radscheduler to show all holidays during year. So I use it in simple way and show only Yearview to user. I found that Radscheduler ignore culture in Yearview for ColumnHeaderDate. If it is set to default value 'ddd' then it always show English translation. If I switch to monthly view it is correct and translated.

Can you help me how to fix this problem? Is there a way how to override this?

Thank you,

Petr

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter Milchev
Telerik team
answered on 02 Apr 2020, 04:27 PM

Hello Petr,

You are correct, the headers are indeed not respecting the Scheduler's culture. I have logged it in our feedback portal where you can follow its status:

Nevertheless, you can use the following approach that fixes it:

protected void Page_Load(object sender, EventArgs e)
{
    var dates = new Dictionary<string, string>();
    for (int i = 0; i < 7; i++)
    {
        var date = new DateTime().AddDays(i);
        var englishDate = date.ToString(RadScheduler1.YearView.ColumnHeaderDateFormat);
        var correctDate = date.ToString(RadScheduler1.YearView.ColumnHeaderDateFormat, RadScheduler1.Culture);
        dates.Add(englishDate, correctDate);
    }

    var serializer = new AdvancedJavaScriptSerializer();
    HiddenFieldDates.Value = serializer.Serialize(dates);

}

<asp:HiddenField ID="HiddenFieldDates" runat="server" />
<telerik:RadCodeBlock runat="server">
    <script>
        function pageLoadHandler() {
            var dates = JSON.parse($get("<%=     HiddenFieldDates.ClientID %>").value);

            $telerik.$(".rsYearMonthWrap tr:nth-of-type(2) th").each(function (ind, item) {
                $telerik.$(this).text(dates[$telerik.$(this).text()]);
            })
            // Sys.Application.remove_load(pageLoadHandler);  
        }
        Sys.Application.add_load(pageLoadHandler);
    </script>
</telerik:RadCodeBlock>

As a token of gratitude for bringing this to our attention, I have updated your Telerik points.

Regards,
Peter Milchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Petr
Top achievements
Rank 1
Iron
answered on 24 Apr 2020, 08:45 AM

Sorry for late answer. Now I implemented your fix and I can confirm that it works as expected.

Thank you,

Petr

Tags
Scheduler
Asked by
Petr
Top achievements
Rank 1
Iron
Answers by
Peter Milchev
Telerik team
Petr
Top achievements
Rank 1
Iron
Share this question
or