By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,401 Members | 803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,401 IT Pros & Developers. It's quick & easy.

Week of year

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
"Kejpa" <kS*******@saj.fi> wrote in message
news:cp**********@gandalf.alcom.aland.fi...
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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.