Week of year

  • Thread starter Thread starter Kejpa
  • Start date Start date
K

Kejpa

Hi,
I've bumped into some strange behaviour when trying to set the localization
of my app.
I want it to have Monday as the first day of week and the first 4 day-week
as week # 1.

However,
Jan 1 is always week 1 in VB ... Not in my calendar, next year for instance
it's week 53 (of this year)
Jan 31 1999 is interesting. With my settings it would be week 4, but VB
reports it as week 6 (which it will be if Jan1 is in week1 and Sunday is the
first day of the week)

Doesn't the settings of FirstDayOfWeek and CalendarWeekRule have any
affect?!?

Puzzled!
/Kejpa
 
ok, so I've done some research and found that
DatePart(DateInterval.WeekOfYear, Date())

isn't using FirstDayOfWeek.System and FirstWeekOfYear.System as the default
but merely FirstDayOfWeek.Sunday and FirstWeekOfYear.Jan1 as the default
values.

This is really bad behaviour.



/Kejpa
 
Back
Top