B
bp
I'm using the System.Globalization.GregorianCalendar class to calculate
week numbers. My weeks begin on Saturday and follow the "first four
day" rule.
GregorianCalendar cal = new GregorianCalendar();
week = cal.GetWeekOfYear("12/31/2005",
CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Saturday);
GetWeekOfYear() returns "53" for "12/31/2005", even though there are
only 52 weeks in 2005. "12/30/2005" correctly returns "52", and
"1/1/2006" correctly returns "1".
Can someone explain this to me? Is this intended behavior or is this a
bug in the GregorianCalendar class?
Thanks in advance.
week numbers. My weeks begin on Saturday and follow the "first four
day" rule.
GregorianCalendar cal = new GregorianCalendar();
week = cal.GetWeekOfYear("12/31/2005",
CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Saturday);
GetWeekOfYear() returns "53" for "12/31/2005", even though there are
only 52 weeks in 2005. "12/30/2005" correctly returns "52", and
"1/1/2006" correctly returns "1".
Can someone explain this to me? Is this intended behavior or is this a
bug in the GregorianCalendar class?
Thanks in advance.