summaryrefslogtreecommitdiff
path: root/modules/calendar.class
diff options
context:
space:
mode:
Diffstat (limited to 'modules/calendar.class')
-rw-r--r--modules/calendar.class16
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/calendar.class b/modules/calendar.class
index 16498c6bb..0c16001cc 100644
--- a/modules/calendar.class
+++ b/modules/calendar.class
@@ -17,7 +17,7 @@ class Calendar {
// Extract first day of the month:
$first = date("w", mktime(0, 0, 0, $month, 1, $year));
-
+
// Extract last day of the month:
$last = date("t", mktime(0, 0, 0, $month, 1, $year));
@@ -30,11 +30,11 @@ class Calendar {
$output .= "<TABLE WIDTH=\"100%\" BORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"1\">\n";
$output .= " <TR><TD ALIGN=\"center\" COLSPAN=\"7\"><SMALL><A HREF=\"index.php?date=$prev\">&lt;</A> &nbsp; ". date("F Y", $this->date) ." &nbsp; <A HREF=\"index.php?date=$next\">&gt;</A></SMALL></TD></TR>\n";
$output .= " <TR><TD ALIGN=\"center\"><SMALL>S</SMALL></TD><TD ALIGN=\"center\"><SMALL>M</SMALL></TD><TD ALIGN=\"center\"><SMALL>T</SMALL></TD><TD ALIGN=\"center\"><SMALL>W</SMALL></TD><TD ALIGN=\"center\"><SMALL>T</SMALL></TD><TD ALIGN=\"center\"><SMALL>F</SMALL></TD><TD ALIGN=\"center\"><SMALL>S</SMALL></TD></TR>\n";
-
+
// Initialize temporary variables:
$nday = 1;
$sday = $first;
-
+
// Loop through all the days of the month:
while ($nday <= $last) {
// Set up blank days for first week of the month:
@@ -42,25 +42,25 @@ class Calendar {
$output .= " <TR><TD COLSPAN=\"$first\">&nbsp</TD>\n";
$first = 0;
}
-
+
// Start every week on a new line:
if ($sday == 0) $output .= " <TR>\n";
-
+
// Print one cell:
$date = mktime(23, 59, 59, $month, $nday, $year);
if ($nday == $day) $output .= " <TD ALIGN=\"center\"><SMALL><B>$nday</B></SMALL></TD>\n";
else if ($date > time()) $output .= " <TD ALIGN=\"center\"><SMALL>$nday</SMALL></TD>\n";
else $output .= " <TD ALIGN=\"center\"><SMALL><A HREF=\"index.php?date=$date\" STYLE=\"text-decoration: none;\">$nday</A></SMALL></TD>\n";
-
+
// Start every week on a new line:
if ($sday == 6) $output .= " </TR>\n";
-
+
// Update temporary variables:
$sday++;
$sday = $sday % 7;
$nday++;
}
-
+
// Complete the calendar:
if ($sday) {
$end = 7 - $sday;