\App\Module::exists((string)$k)
));
$todayMarks = $todayMarks ?? ['tags' => [], 'line' => ''];
?>
= e(\App\Auth::homeTitle()) ?>
= e($heroSlogan) ?>
= e($hbPart) ?>,= e((string)$meName) ?>
= e((string)($todayLabel ?? date('n 月 j 日'))) ?>
= e((string)($weekday ?? '')) ?>
= e((string)$lunarShort) ?>
= e((string)$mk['word']) ?>
= e((string)($weather['icon'] ?? '')) ?>
= e((string)($weather['temp'] ?? '')) ?>
= e((string)($weather['text'] ?? '')) ?>
= $weather['wdir'] !== '' ? e((string)$weather['wdir']) . ' ' : '' ?>= e((string)$weather['wind']) ?>
= e((string)$weather['place']) ?>
= $endH) { $endH = min(24, $nowHNow + 2); }
if ($endH <= $startH) { $endH = min(24, $startH + 2); }
}
/* 红线位置:**分钟级**(与日程页同一算法)。见上面 v44 那条 —— 原来是 `date('G')`
(整小时),所以"7:44 的红线停在 7:00"。 */
$nowMinutes = ((int)date('G')) * 60 + (int)date('i');
$nowPos = (($nowMinutes / 60) - $startH) / max(1, ($endH - $startH)); // 红线位置(0~1)
$showNow = $nowPos >= 0 && $nowPos <= 1;
/* 🔴 v30 第 2/4 条:首页日程也用**和日程模块同一套冲突分列**。
⇒ 复用 App\Calendar::conflictLanes(算法借鉴 SyncCalendar 的 TimelineUtil):
两条撞车就左右各半、三条就三分 —— 首页与日历页看到的是同一个布局。
⚠️ 必须**先按时间排序**再分列(lanes 是按传入顺序返回的):
`$todayEvents` 从路由出来已是"全天在前、其余按时刻"升序,这里再稳一次。
⚠️ 入参只挑**有时间**的那些(全天日程不进时间网格)。 */
usort($timed, static function (array $a, array $b): int {
return strcmp((string)($a['time'] ?? ''), (string)($b['time'] ?? ''));
});
$laneInfo = \App\Calendar::conflictLanes($timed);
foreach ($timed as $i => &$evRef) {
[$l, $w] = $laneInfo[$i] ?? [0.0, 1.0];
$evRef['left'] = round($l * 100, 4);
$evRef['width'] = round($w * 100, 4);
}
unset($evRef);
?>
0) { $evEdit = url('calendar/event', ['id' => $evRef, 'embed' => 1]); }
elseif ($evKind === 'movie' && $evRef > 0) { $evEdit = url('movies/edit', ['id' => $evRef, 'embed' => 1]); }
elseif ($evKind === 'task' && $evRef > 0) { $evEdit = url('tasks/edit', ['id' => $evRef]); }
elseif ($evKind === 'anniv' && $evRef > 0) { $evEdit = url('days/edit', ['id' => $evRef, 'embed' => 1]); }
?>
'>
全天
= e((string)$ev['title']) ?>
= e((string)$ev['calname']) ?>
= sprintf('%02d:00', $h) ?>
0) { $evEdit = url('calendar/event', ['id' => $evRef, 'embed' => 1]); }
elseif ($evKind === 'movie' && $evRef > 0) { $evEdit = url('movies/edit', ['id' => $evRef, 'embed' => 1]); }
elseif ($evKind === 'task' && $evRef > 0) { $evEdit = url('tasks/edit', ['id' => $evRef]); }
elseif ($evKind === 'anniv' && $evRef > 0) { $evEdit = url('days/edit', ['id' => $evRef, 'embed' => 1]); }
?>
'
style="background: = e((string)$ev['color']) ?>;
top: = number_format($topPct, 2) ?>%;
height: = number_format($hPct, 2) ?>%;
left: calc(46px + = (float)($ev['left'] ?? 0) ?>% + 2px);
width: calc(= (float)($ev['width'] ?? 100) ?>% - 4px);"
title="= e((string)$ev['title']) ?>"
data-cal="= (int)$ev['cal'] ?>">
= e((string)$ev['time']) ?>
= e((string)$ev['title']) ?>
= e((string)$ev['calname']) ?>
通知消息
0): ?>= (int)$notifUnread ?> 条未读
往年的今天
= e(date('n 月 j 日')) ?>
往年的这一天还没有记录
日子还长,等有了第一次,明年这时候就会自己冒出来。