On Fri, 24 Jan 2003, Peter J. Acklam wrote: > I believe this thread proves that what is considered the first day > of the week must be customizable. If it isn't, then someone > (perhaps not someone on this mailing list, but someone) will be > dissatisfied and consider the "DateTime" modules useless and write > their own modules -- and much of the point with the "DateTime" > modules will be lost.
As Rich pointed out, the idea of offering a rich API that supports all of these things is good. The idea of a narrow API which has a changing meaning is very bad. We already have some of the rich API needed, like "day_of_week" and "day_of_week_0". > In relation to week numbers and day of week numbers, there are > at least four parameters that must be customizable: > > 1) What is the first day of a week (Sunday, Monday, ...)? I just need method names for this. Monday as first day of week is "day_of_week" (Monday is 1) and "day_of_week_0" (Monday is 0). Equivalent methods using Sunday are welcome, but they need good names. > 2) What is the number of this day (0, 1)? See above. > 3) How many days of a week must be in the new year before > the week is considered the first week in the new year? > (ISO: 4, US: 1 and 7) Eek, I'm not sure I want to touch this yet. But if people have good mehod names, I'm happy to include it. > 4) What is the number of this week (0, 1)? This can be done with more *_0 methods. This all comes down to have appropriately named methods, basically. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/