[dev] patch for month -- array is wrong size in month.php

David U. davidu@everydns.net
Sat, 14 Sep 2002 23:47:34 -0500


I'm not sure if others have this issue but I was getting the last day of
every month being an out-of-bounds error for the $allevents array.

This seems to fix it for me. I believe it is because there is no "zero" day.
To be honest, I don't understand exactly why the zero wasn't working for me
but this did fix it as far as I can tell.

Thoughts?

Index: month.php
===================================================================
RCS file: /repository/kronolith/month.php,v
retrieving revision 1.95
diff -p --unified=3 -r1.95 month.php
--- month.php   14 Sep 2002 15:42:10 -0000      1.95
+++ month.php   15 Sep 2002 04:44:20 -0000
@@ -71,7 +71,7 @@ for ($i = 0; $i < $startday; $i++) {
 }

 $startDate = Kronolith::timestampToObject(mktime(0, 0, 0, $month, 1,
$year));
-$endDate = Kronolith::timestampToObject(mktime(0, 0, 0, $month + 1, 0,
$year));
+$endDate = Kronolith::timestampToObject(mktime(0, 0, 0, $month + 1, 1,
$year));
 $allevents = Kronolith::getEventRange($startDate, $endDate,
$GLOBALS['display_calendars']);

 $dayofweek = $startday;

Thanks,
davidu


--
"Never doubt that a small group of thoughtful citizens can change the
world. Indeed, it is the only thing that ever has." --Margaret Mead