[pmwiki-users] ISO week number in PmCalendar
Patrick R. Michaud
pmichaud at pobox.com
Thu May 25 07:40:34 CDT 2006
On Thu, May 25, 2006 at 02:24:56PM +0200, Joachim Durchholz wrote:
> christian.ridderstrom at gmail.com schrieb:
> > Here's a caveat... different countries number the weeks differently.
> > Anyone that implements this needs to remember that. (I've been bitten
> > by arranging something on week 35 according to my Yahoo calendar only to
> > find out that week 35 was actually week 36 in Sweden).
> Ah, right.
> It depends on what rules are applied wrt. the typical "half week" at the
> beginning of the years. There seem to be several strategies here:
> 1) The fractional week is counted as part of the previous year. I.e. Jan
> 1, 2006 would be in week 52/2005.
> 2) The fractional week is week zero. Jan 1, 2006 is in week 0/2006.
> 3) The fractional week is week one.
> 4) The fractional week is week one if it has four or more days.
> Otherwise, we apply strategy 1 or 3. (Strategy 2, while technically an
> option, doesn't make sense.)
> Seems like this list exhausts the possibilities (or did I overlook one?)
FWIW, the strftime() function has a number of different formats
for computing week numbers according to various criteria
More information about the pmwiki-users