Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic weeks don't start with saturday here (Read 3541 times)
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
weeks don't start with saturday here
Jan 25th, 2010 at 9:19am
Print Post  
Where can I change this to Monday?

(I'm aware of rumors that somewhere in the world weeks start with sunday -- but saturday??)
  

/\/\arkus.
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: weeks don't start with saturday here
Reply #1 - Jan 25th, 2010 at 9:47am
Print Post  
Try the following code (assuming that your Calendar is identified by the variable cal):

Code
Select All
cal.BeginInit();
cal.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday;
cal.EndInit(); 


The BeginInit/EndInit block is essential because changing properties of the DateTimeFormat alone does not cause updates.

Regards,
Meppy
  
Back to top
 
IP Logged
 
springy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 76
Joined: Jan 25th, 2010
Re: weeks don't start with saturday here
Reply #2 - Jan 25th, 2010 at 10:10am
Print Post  
Thanks, didn't notice this property hierarchy.

But could you please remove the FirstDayOfWeek=DayOfWeek.Saturday somewhere in your code?

Because cal.DateTimeFormat.DayNames, ~MonthNames etc. are all German but .FirstDayOfWeek is still Saturday.

In contrast CultureInfo.CurrentCulture.DateTimeFormat also contains the German DayNames (and so forth) but FirstDayOfWeek correctly is set to Monday.
  

/\/\arkus.
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: weeks don't start with saturday here
Reply #3 - Jan 25th, 2010 at 10:47am
Print Post  
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint