[Seaside] WAMiniCalendar bug (and fix)
frank.shearar at angband.za.org
Tue Mar 30 14:41:21 UTC 2010
I played around a bit with WAMiniCalendar today, and found something
funny. I went back to March 2008, and I can see an extra row. The first
row of the table is completely blank -
- and then the rest of the month is displayed normally.
That's happening because March 2008 starts on a Sunday.
WAMiniCalendar>>weeksDo: needs to look like this:
| day nextMonth |
day := Date newDay: 1 monthNumber: self monthIndex year: self year.
(day dayOfWeek < 7) ifTrue: [day := day subtractDays: day dayOfWeek].
nextMonth := (self monthIndex \\ 12) + 1.
[ day monthIndex = nextMonth ] whileFalse: [
aBlock value: day.
day := day addDays: 7 ]
(Summary: day := day subtractDays: day dayOfWeek gets a conditional.)
More information about the seaside