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

推荐订阅源

博客园 - Franky
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
Y
Y Combinator Blog
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
M
MIT News - Artificial intelligence
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
博客园 - 司徒正美
I
InfoQ
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
U
Unit 42

博客园 - 水村

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