month/week format (was: [imp] summary is broken)

Cliff Green green@UMDNJ.EDU
Thu, 12 Jul 2001 12:32:16 -0400


Quoting Jan Schneider <janmailing@gmx.de>:

> OK, this is what I found out:
>
> --snip--
> In [ISO8601], the week number is defined by:
>
> - weeks start on a monday - week 1 of a given year is the one that includes
> the first Thursday of that  year. (or, equivalently, week 1 is the week that
includes 4
> January.)
>
> This means that the days before week 1 in a given year are attributed to
> the  last week of the previous year. Also the days that come after the last
> week of  a given year are attributed to the first week of the next year.
> --snip--
>
> This leeds to one problem: In ISO there is no week starting on Sunday.

I don't think that would make a difference, so it can probably be ignored.
(Now, if the weekend were a couple of days longer, *that* might make a
difference ;-).

> But it  makes sense to calculate weeknumbers the same way and just let the Sunday
> belong to the week of the following Monday.

Agreed.  The calculations should work out the same, and Simpler Is Better, no?

> Does this fit to American weeknumbers?

I don't see why not.  The only thing that changes is the way weeks and months
are displayed, not how they're counted.

> If so we just have to modify the weekOfYear function.

Sounds enticing - change one function instead of patch a couple of dependent
scripts; but on reflection, I don't know if that's necessary.  Again, the
counting doesn't change, just  how the weeks/months are displayed.

As it turns out, a simple offset (different from the one I used before) can be
added to the display line in month.php, and it looks like it works cleanly for
both displays (International style or American style).  I'll send you the
revised diffs under separate cover for review.

> Zitat von Cliff Green <green@UMDNJ.EDU>:
> > Quoting Jan Schneider <janmailing@gmx.de>:
> > > I took a quick look into your code and found that the week numbers
> > > change in the month view if you select another week start.
> > > Since I don't have an American calendar at hand I'm not sure if this
> > > is correct. Could you please find it out?
> >
> > Yes, definitely.  The week is offset by one and is wrong.  I can insert
> > an  offset into month.php and everything is okay except the last week of
> > any given month is displayed as (Week 0).  Very Frustrating.

c
--
Cliff Green
Academic Computing Services - UMDNJ
signature under NDA


-----------------------------------------------------
This mail sent through IMP: the Internet Mail Program