On the first day of Microsoft

by Michael S. Kaplan, published on 2006/06/17 03:11 -04:00, original URI: http://blogs.msdn.com/b/michkap/archive/2006/06/17/635012.aspx

No, I am not going to burst into song here -- that takes at a minimum a great deal of alcohol. :-)

I am also not going to write about Bill Gates and the early days of the company that was once known as Micro-Soft. :-)

I am going to talk about some confusion around the meaning of "the first day" in the locale/culture data, though....

A few days ago, I pointed out that Size matters (when it comes to day names, at least). And Josh raised an interesting question about it:

This documentation seems to imply that Monday is always the first day of the week... Different revisions of the docs?

Now the underlying issue is interesting on a few different levels.

First of all, there is the fact that there is a small documentation bug here, since all three of:

are always Monday, across all locales. Yet two of them are documented as being Monday and the third just has the vague language about "the first day of the week".

Second of all, there is the confusion that in the managed members that contain all of the analagous items:

each start with Sunday, rather than Monday. Makes things kinda confusing for the Microsoft Locale Builder, don't it? :-)

And now let's add yet another wrinkle to the mix: the LCTYPE named LOCALE_IFIRSTDAYOFWEEK (a number 0-6 signifying which day from Monday to Sunday is the first day of the week within a locale) and DateTimeFormatInfo.FirstDayOfWeek (a member of the DayOfWeek enumeration that has the analagous role within a culture).

Isn't it weird to think about the first day of the week being the first member of an enumerated list and also to think about it being its own configurable setting?

Especially if the two do not match in your locale/cultures? :-)

Now remembering that all that is in .NET's cultures was originally based on the locales of Windows, the exact reason behind why managed code moved back a day is an interesting one to ponder. I'll open it up to readers if someone wants to give their theory for why the change was made (remembering that if, when DateTimeFormatInfo was created, it were known they would come back together for custom cultures/locales no change probably would have happened!)....


This post brought to you by Δ (U+0394, a.k.a. GREEK CAPITAL LETTER DELTA)

# Mihai on 18 Jun 2006 8:02 PM:

"open it up to readers if someone wants to give their theory for why the change was made"

Because the developers had not clue and thought "what is this stupid thing with Monday as first day? Everybody knows the first day of week is Sunday."
There you have it :-)

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day