docs: 添加日历功能警告注释(防止误删)

This commit is contained in:
maoshen
2026-04-15 02:16:19 +00:00
parent e91b58b079
commit c8178ce98f
2 changed files with 41 additions and 3 deletions

View File

@@ -4,6 +4,19 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>码神的日记系统</title>
<!--
⚠️⚠️⚠️ 核心功能:日历组件 ⚠️⚠️⚠️
修改此文件前必须:
1. 阅读 docs/CALENDAR.md 了解日历功能
2. 确认不会删除日历相关代码
3. 修改后运行 test_frontend.py diary 验证
日历功能包括:
- 月历视图显示
- 点击日期显示日记
- 上月/下月切换
- 有日记的日期标记 📝
-->
<style>
* {
margin: 0;
@@ -102,7 +115,7 @@
border-bottom: 2px solid #667eea;
}
/* 日历组件 */
/* ⚠️ 日历组件样式 - 核心功能,不可删除 */
.calendar-wrapper {
display: flex;
gap: 20px;
@@ -596,6 +609,7 @@
return state.allEntries.find(entry => entry.date === date);
}
// ⚠️ 核心功能:渲染日历 - 不可删除
function renderCalendar(year, month, selectedDate, hasDataDates) {
const firstDay = new Date(year, month, 1);
const lastDay = new Date(year, month + 1, 0);
@@ -896,6 +910,7 @@
render();
}
// ⚠️ 核心功能:选择日期显示日记 - 不可删除
function selectDate(date) {
state.selectedDate = date;
render();
@@ -906,6 +921,7 @@
render();
}
// ⚠️ 核心功能:切换月份 - 不可删除
function changeMonth(delta) {
if (!state.currentCalendar) {
state.currentCalendar = new Date();