最简单的日历控件“星期几”变为“几”
原来真的很简单。
1private void WebCalendar_PreRender(object sender, System.EventArgs e)
2{
3 Thread threadCurrent = Thread.CurrentThread;
4 CultureInfo ciNew = (CultureInfo)threadCurrent.CurrentCulture.Clone();
5 if(ciNew.LCID == 2052)
6 {
7 ciNew.DateTimeFormat.DayNames = new string[]{"日","一","二","三","四","五","六"};
8 ciNew.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Sunday;
9 threadCurrent.CurrentCulture = ciNew;
10 }
11}
2{
3 Thread threadCurrent = Thread.CurrentThread;
4 CultureInfo ciNew = (CultureInfo)threadCurrent.CurrentCulture.Clone();
5 if(ciNew.LCID == 2052)
6 {
7 ciNew.DateTimeFormat.DayNames = new string[]{"日","一","二","三","四","五","六"};
8 ciNew.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Sunday;
9 threadCurrent.CurrentCulture = ciNew;
10 }
11}