[Seaside] WAMiniCalendar showing wrong week day names

Frank Shearar frank.shearar at angband.za.org
Tue Jun 8 13:46:22 UTC 2010

On 2010/06/08 13:46, Frank Shearar wrote:
> On 2010/06/08 11:43, AxiNat wrote:
>> Hi list,
>> I've a funny problem when calling a WAMiniCalendar, dates don't
>> correspond to week days. Check this out:
> It looks like an off-by-one error, where the calendar day's always one
> day ahead of the real day.
> #weeksDo: is the guy that renders the actual calendar, and the title's
> supplied by #weekDays.
> And it looks like the bug's been around a long time, because it's in
> dkh's version of #weeksDo: from 2008. Unless of course the bug's elsewhere.

In the grand tradition of fixing-by-perturbation, perhaps this will work:

---  (day dayOfWeek < 7) ifTrue: [day := day subtractDays: (day dayOfWeek)].
+++  (day dayOfWeek < 7) ifTrue: [day := day subtractDays: (day 
dayOfWeek - 1)].

Justification: Sunday is dayOfWeek 1. if day points to a Wednesday (so 
day dayOfWeek returns 4), then we want day dayOfWeek to return 1, so we 
need to subtract 3, or "day dayOfWeek - 1" days.


More information about the seaside mailing list