Week of year

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
 
K

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top