Improvements to the calendar widget

This commit is contained in:
2026-02-18 21:10:03 +01:00
parent 1e52f75627
commit c90d7e18bc
3 changed files with 46 additions and 8 deletions

View File

@@ -45,10 +45,6 @@ class ChronologicalCalendarWidget
$leadingEmpty = $firstWeekday - 1;
$totalCells = (int)ceil(($leadingEmpty + $daysInMonth) / 7) * 7;
$todayY = (int)date('Y');
$todayM = (int)date('m');
$todayD = (int)date('d');
$dayUrlTemplate = function_exists('wl') ? (string)wl('__LUXTOOLS_ID_RAW__') : '';
$monthUrlTemplate = $dayUrlTemplate;
$yearUrlTemplate = $dayUrlTemplate;
@@ -109,11 +105,8 @@ class ChronologicalCalendarWidget
$dayId = ChronoID::dateToDayId($date, $baseNs);
$classes = 'luxtools-calendar-day';
if ($year === $todayY && $month === $todayM && $dayNumber === $todayD) {
$classes .= ' luxtools-calendar-day-today';
}
$html .= '<td class="' . hsc($classes) . '">';
$html .= '<td class="' . hsc($classes) . '" data-luxtools-date="' . hsc($date) . '">';
if ($dayId !== null && function_exists('html_wikilink')) {
$html .= (string)html_wikilink($dayId, (string)$dayNumber);
} else {