3 Answers, 1 is accepted
0
Hello Jean-Yves,
In order to make RadCalendar apply week numbers according to the ISO 8601 standard, please use the approach demonstrated below.
By default RadCalendar does not apply week numbers according to the ISO standard, because the ASP.NET framework itself does not do this.
Best wishes,
Dimo
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
In order to make RadCalendar apply week numbers according to the ISO 8601 standard, please use the approach demonstrated below.
By default RadCalendar does not apply week numbers according to the ISO standard, because the ASP.NET framework itself does not do this.
<%@ Page Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<
script
runat
=
"server"
>
protected void Page_Load(object sender, EventArgs e)
{
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo(RadCalendar1.CultureInfo.ToString());
c.DateTimeFormat.CalendarWeekRule = System.Globalization.CalendarWeekRule.FirstFourDayWeek;
RadCalendar1.CultureInfo = c;
}
</
script
>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
meta
http-equiv
=
"content-type"
content
=
"text/html;charset=utf-8"
/>
<
title
>RadControls for ASP.NET AJAX</
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
/>
<
telerik:RadCalendar
ID
=
"RadCalendar1"
runat
=
"server"
FirstDayOfWeek
=
"Monday"
/>
</
form
>
</
body
>
</
html
>
Best wishes,
Dimo
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jonathan Puddle
Top achievements
Rank 1
answered on 26 Apr 2010, 11:02 AM
Hi, this modification only works when using the full calendar. We're just using the datepicker control, and so it doesn't work. Please advise how we can tweak just the datepicker control when used in an edit form.
0
Jean-Yves
Top achievements
Rank 1
answered on 26 Apr 2010, 12:01 PM
Hello Jonathan,
In fact I had the problem on each control too.
So I did a Class :
public class RadCalendarLocalizer |
{ |
public static void localize(RadCalendar radCalendar) |
{ |
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo(radCalendar.CultureInfo.ToString()); |
c.DateTimeFormat.CalendarWeekRule = System.Globalization.CalendarWeekRule.FirstFourDayWeek; |
radCalendar.CultureInfo = c; |
} |
public static void localize(RadDatePicker radDatePicker) |
{ |
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo(radDatePicker.Calendar.CultureInfo.ToString()); |
c.DateTimeFormat.CalendarWeekRule = System.Globalization.CalendarWeekRule.FirstFourDayWeek; |
radDatePicker.Calendar.CultureInfo = c; |
} |
public static void localize(RadTimePicker radTimePicker) |
{ |
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo(radTimePicker.Calendar.CultureInfo.ToString()); |
c.DateTimeFormat.CalendarWeekRule = System.Globalization.CalendarWeekRule.FirstFourDayWeek; |
radTimePicker.Calendar.CultureInfo = c; |
} |
public static void localize(RadDateTimePicker radDateTimePicker) |
{ |
System.Globalization.CultureInfo c = new System.Globalization.CultureInfo(radDateTimePicker.Calendar.CultureInfo.ToString()); |
c.DateTimeFormat.CalendarWeekRule = System.Globalization.CalendarWeekRule.FirstFourDayWeek; |
radDateTimePicker.Calendar.CultureInfo = c; |
} |
} |
And each time I use a componant I localize them.
For me it works :)