FirstDayOfWeek="monday" ?

Topics: ASP.NET 2.0, Themes
Oct 11, 2007 at 5:23 PM

the issue

*I have a 1.2 installation which I test on iis6 and deploy on iis7.
*I have a little calendar control, and the "large calendar control". In BE 1.1 I could not get the latter to work reliably; it seems to work on in 1.2 which is great.

I can change the small calendar start-of-week setting, but th eLarge calendar has no setting for this. My large calendar defaults to starting the week on Sunday.

investigations

Looking in my theme I have:
<blog:PostCalendar [...] FirstDayOfWeek="monday" [...]
And indeed I can change the setting of "FirstDayOfWeek" and the little calendar responds accordingly. But there's no such setting for the big calendar. So I kind of assume that the big calendar is therefore reading the "culture" from the machine somewhere, and assuming Mr Bush's calendar rather than the secular one. I guess that's a small defect, although I can't find it logged.

I can change if I change website's culture from en-US to en-GB (actually the site's in Canada...), and:
System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek.ToString();
returns "Monday" for the UK. But the big calendar doesn't take any notice. Odd.

My final test case is two websites running off different ports on the same server. All the web.config files look identical in all important respects... one shows both calendars starting on Monday, the other shows Monday(small) and Sunday(big). Both web sites web.config set the culture, although the web.config in the application is set to "auto" (I tried changing that also to no effect here).

help?

Does anyone know what the big calendar's using to determine the start of week? I guess it can't be machine.config as my two sites share the same one...
Coordinator
Oct 11, 2007 at 5:32 PM
Try go to the default.aspx page where the big calendar is located. In the <asp:calendar tag you can probably set your default day.
Oct 11, 2007 at 8:12 PM
Dang, dang, dang. You're absolutely right. I looked to see where the calendar stuff was, but I didn't look hard enough. I just added

FirstDayOfWeek="monday"

to the PostCalendar tag in default.aspx and it's all good. Thanlks!
Oct 14, 2007 at 6:55 PM
I spoke too soon. You can set the default day, in as much as it doesn't whine on you if you do. It seems to make a difference on my local IIS7 machine, but it has absolutely no effect on my production IIS6 server. What gives, I wonder. What sort of thing could work right on the one server but not the other. Hmm..