\App\Calendar::canWrite($c, (int)\App\Auth::personId()))); // 三种看法各自的「上一段 / 下一段」:月按整月走,周按 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))); $mkUrl = static function (string $v) use ($ym, $prevD, $nextD, $todayD, $prevYm, $nextYm, $thisYm) { if ($v === 'month') { return url('calendar', ['view' => 'month', 'ym' => $ym]); } return null; // 周/天要把具体哪天传进去,由调用方拼 }; ?>

日程

月 周 天 上一月 今天 下一月 今天 日历本
全天
$c): ?>
$c): ?>
3): ?> + 条