惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
C
Check Point Blog
D
Docker
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
量子位
有赞技术团队
有赞技术团队
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
M
MIT News - Artificial intelligence
B
Blog
阮一峰的网络日志
阮一峰的网络日志
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
V2EX
月光博客
月光博客

博客园 - 水村

Backup of css style IIS性能应用程序池设置 查看IIS站点资料占用情况 终于还是要离开了 从ASP过渡到ASP.net遗留的二十大积习 CS中的SQL分页 SQL分页 清理SQL Server日志 收到群硕的offer了 确保只有一个程序实例运行(C#)之解决方案 测试 面向对象设计,ORM,NHIBERNATE杂谈 CSS十大密技 关于博客园的分类设置 Jabber技术概况 想写点什么,却发现心里很空 闲来没事,改了下博客园博客的皮肤 微软笔试归来 今天收到微软HRMM的电话了
修正CS2.0中的日历头显示错误 - 水村 - 博客园
水村 · 2006-03-21 · via 博客园 - 水村

其实和前面版本中是一样的,刚刚改了,又有点小闲,所以,把它贴出来!
在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;
}

然后,将日期显示格式改为短格式,如果你在皮肤中已经设置,就不用在这儿写了,不过,保险起见,还是写一下好:

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);
}