sub(new \DateInterval('P1M')); $nextMonth = $monthCursor->add(new \DateInterval('P1M')); $monthStartDate = sprintf('%04d-%02d-01', $year, $month); $monthDayId = ChronoID::dateToDayId($monthStartDate, $baseNs); $monthId = $monthDayId !== null ? ChronoID::dayIdToMonthId($monthDayId, $baseNs) : null; $yearId = $monthId !== null ? ChronoID::monthIdToYearId($monthId, $baseNs) : null; $prevStartDate = $prevMonth->format('Y-m-d'); $prevDayId = ChronoID::dateToDayId($prevStartDate, $baseNs); $prevMonthId = $prevDayId !== null ? ChronoID::dayIdToMonthId($prevDayId, $baseNs) : null; $nextStartDate = $nextMonth->format('Y-m-d'); $nextDayId = ChronoID::dateToDayId($nextStartDate, $baseNs); $nextMonthId = $nextDayId !== null ? ChronoID::dayIdToMonthId($nextDayId, $baseNs) : null; $leadingEmpty = $firstWeekday - 1; $totalCells = (int)ceil(($leadingEmpty + $daysInMonth) / 7) * 7; $dayUrlTemplate = function_exists('wl') ? (string)wl('__LUXTOOLS_ID_RAW__') : ''; $monthUrlTemplate = $dayUrlTemplate; $yearUrlTemplate = $dayUrlTemplate; $ajaxUrl = defined('DOKU_BASE') ? (string)DOKU_BASE . 'lib/exe/ajax.php' : 'lib/exe/ajax.php'; $html = '
| ' . hsc($weekday) . ' | '; } $html .= '|
|---|---|
| '; } else { $date = sprintf('%04d-%02d-%02d', $year, $month, $dayNumber); $dayId = ChronoID::dateToDayId($date, $baseNs); $classes = 'luxtools-calendar-day'; $html .= ' | '; if ($dayId !== null && function_exists('html_wikilink')) { $html .= (string)html_wikilink($dayId, (string)$dayNumber); } else { $html .= hsc((string)$dayNumber); } $html .= ' | '; } if ($cell % 7 === 6) $html .= '