$weekDay | "; } $text .= "||
\n"; } elseif ( $dayOfTheWeek == 1 || $dayOfTheWeek == 7 ) { $text .= " | \n"; } else { $text .= " | \n";
}
if ( $day == $daysInCurMonth || $day > 50 ) {
$isLastWeek = true;
}
// If this day is before or after the current month,
// set a "display day" to show on the calendar, and
// use a different CSS style for it.
if ( $day > $daysInCurMonth || $day < 1 ) {
if ( $day < 1 ) {
$displayDay = $day + $daysInPrevMonth;
$dateStr =
$prevYear . '-' . $prevMonthNum . '-' . $displayDay;
}
if ( $day > $daysInCurMonth ) {
$displayDay = $day - $daysInCurMonth;
$dateStr =
$nextYear . '-' . $nextMonthNum . '-' . $displayDay;
}
$text .=
" $displayDay \n";
} else {
$dateStr = $curYear . '-' . $curMonthNum . '-' . $day;
$text .= "$day \n";
}
// Finally, the most important step - get the events
// that match this date, and the given set of criteria,
// and display them in this date's box.
$text .= "\n";
if ( $events == null ) {
$events = [];
}
foreach ( $events as $event ) {
list( $eventTitle, $otherText, $eventDate, $color ) = $event;
if ( $eventDate == $dateStr ) {
if ( $this->mTemplate != '' ) {
$templatetext = '{{' . $this->mTemplate . $otherText .
'|thisdate=' . $dateStr . '}}';
$templatetext =
$wgParser->replaceVariables( $templatetext );
$templatetext =
$wgParser->recursiveTagParse( $templatetext );
$text .= $templatetext;
} else {
$eventStr = Linker::link( $eventTitle );
if ( $color != '' ) {
$text .= " $eventStr $otherText |
END;
if ( $dayOfTheWeek == $lastDayOfWeek ) {
$text .= "