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

推荐订阅源

小众软件
小众软件
博客园 - Franky
罗磊的独立博客
G
Google Developers Blog
The GitHub Blog
The GitHub Blog
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
V
V2EX
F
Fortinet All Blogs
阮一峰的网络日志
阮一峰的网络日志
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
U
Unit 42
GbyAI
GbyAI
A
About on SuperTechFans
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
Microsoft Azure Blog
Microsoft Azure Blog
Martin Fowler
Martin Fowler
D
DataBreaches.Net
The Cloudflare Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
MongoDB | Blog
MongoDB | Blog

博客园 - 水村

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