MonthCalendar-Control中的周数 [英] Week numbers in MonthCalendar-Control

查看:164
本文介绍了MonthCalendar-Control中的周数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我在vb.net中使用MonthCalendar-Control。我使用控件的.showWeekNumber属性。



我现在注意到2016年的周数有误。每周数字都是1个数字太高:

当我查看MonthCalender-Control并查看2015年12月和2016年1月时,我发现一周有两周的数字!


$ 2015年12月b $ b,从2015-12-28开始,2016年1月显示周数53

,同一周数字为1



因此结果是2016年的所有周数都算错了。这似乎是dotNet-Framework中的一个错误。我不知道如何纠正这个。



有没有人建议?

In my project I use the MonthCalendar-Control in vb.net. I use the .showWeekNumber property of the control.

I now noticed that there is an error in the week numbers in year 2016. Each week number is 1 number too high:
When I look at the MonthCalender-Control and view December 2015 and also Jannuary 2016 then I see that one week hast two week-numbers!

in December 2015, starting with 2015-12-28, there is shown week number 53
in Jannuary 2016, the same week has the number 1

So the result is that all weeks in 2016 are counted wrong. It seems that this is an error in the dotNet-Framework. I have no idea how to correct this.

Has anyone suggestions?

推荐答案

可能是你的结果是错的。您确定按照 ISO 8601周日期 [ ^ ]?
It may be your result that is wrong. Are you sure you are computing this number as per ISO 8601 week date[^]?


看起来有点像这样。 Bu看一下outlook 2010.在那里你可以设置如何在outlook-calendar-options的设置中计算一年的第一周。第一周的选项是:

- 包含1月1日的一周

- 第一周完整

- 第一周,新年4天(这是iso 8601)



假设outlook使用相同的monthCalendar控件,似乎控件的未记录属性可以设置完全相同。但是如何获得这个属性?
Seems a bit like this. Bu have a look at outlook 2010. There you can set how to calculate the first week of a year in the settings of outlook-calendar-options. Options for first week are:
- week containing Jannuary 1st
- first full week
- first week with 4 days of the new year (this is iso 8601)

So supposing that outlook uses the same monthCalendar-control there seems to be an undocumented property of the control where you can set exactly this. But how to get this property?


这篇关于MonthCalendar-Control中的周数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆