在CommunityServer.Blogs.Controls.WeblogCalendar中,找到构造函数,加入如下代码:
public WeblogCalendar()
{
string[] weekdayAry = new string[] { "日", "一", "二", "三", "四", "五", "六" };
System.Globalization.CultureInfo info = new System.Globalization.CultureInfo("zh-CN");
info.DateTimeFormat.AbbreviatedDayNames = weekdayAry;
System.Threading.Thread.CurrentThread.CurrentCulture = info;
}
{
string[] weekdayAry = new string[] { "日", "一", "二", "三", "四", "五", "六" };
System.Globalization.CultureInfo info = new System.Globalization.CultureInfo("zh-CN");
info.DateTimeFormat.AbbreviatedDayNames = weekdayAry;
System.Threading.Thread.CurrentThread.CurrentCulture = info;
}
然后,将日期显示格式改为短格式,如果你在皮肤中已经设置,就不用在这儿写了,不过,保险起见,还是写一下好:
protected override void AttachChildControls()
{
postCalendar = FindControl("PostCalendar") as Calendar;
// Jerry 将日期格式改成短格式
//
postCalendar.DayNameFormat = DayNameFormat.Short;
postCalendar.DayRender +=new DayRenderEventHandler(postCalendar_DayRender);
postCalendar.VisibleMonthChanged +=new MonthChangedEventHandler(postCalendar_VisibleMonthChanged);
}
{
postCalendar = FindControl("PostCalendar") as Calendar;
// Jerry 将日期格式改成短格式
//
postCalendar.DayNameFormat = DayNameFormat.Short;
postCalendar.DayRender +=new DayRenderEventHandler(postCalendar_DayRender);
postCalendar.VisibleMonthChanged +=new MonthChangedEventHandler(postCalendar_VisibleMonthChanged);
}