\App\Calendar::canWrite($c, (int)\App\Auth::personId()))); $visCals = array_map('intval', (array)($visCals ?? [])); $hiddenCals = array_map('intval', (array)($hiddenCals ?? [])); $newAt = (string)($newAt ?? ''); // 能不能"点一下建日程":只读账号点了没反应,所以连十字光标都不给(见 CSS 的 rt-writable) $canNew = $canWrite && (bool)$writable; // 三种看法各自的「上一段 / 下一段」:月按整月走,周按 7 天走,天按 1 天走 $step = $view === 'week' ? 7 : ($view === 'day' ? 1 : 0); $prevD = date('Y-m-d', strtotime('-' . $step . ' days', strtotime($anchor))); $nextD = date('Y-m-d', strtotime('+' . $step . ' days', strtotime($anchor))); $todayD = date('Y-m-d'); $headText = $view === 'month' ? date('Y 年 n 月', $ts) : ($view === 'week' ? date('Y 年 n 月 j 日', strtotime($anchor)) . ' 起这一周' : date('Y 年 n 月 j 日', strtotime($anchor))); ?>