本帖最后由 dada02 于 2026-1-13 14:46 编辑
html简单日历备忘录
【再来一款备忘录,风格不同,功能简单灵活易用】
软件功能截图
功能介绍和使用说明
导航日历:使用左右箭头按钮或键盘左右箭头键切换月份
选择日期:点击日历中的任意日期即可查看该日期的备忘录
添加备忘录:在右侧输入框中输入内容,点击"添加"或按Enter键
删除备忘录:点击备忘录右侧的按钮删除相应条目
保存备忘录:所有备忘录自动保存,支持json格式导出和导入数据,可通过云共享实现数据迁移
搜索备忘录:支持仅搜索未完成的备忘录、仅搜索当前月份,显示结果列表
未完成备忘录:一键显示本月未完成的备忘录,高亮显示
关键代码
// 搜索备忘录
function searchMemos() {
const keyword = searchInput.value.trim();
if (!keyword) {
showNotification('请输入搜索关键词', true);
return;
}
const searchIncompleteOnly = document.getElementById('search-incomplete-only').checked;
const searchCurrentMonthOnly = document.getElementById('search-current-month').checked;
searchResults = [];
const year = currentDate.getFullYear();
const month = currentDate.getMonth();
Object.keys(memos).forEach(dateKey => {
// 如果只搜索当前月份,检查日期是否在当前月份
if (searchCurrentMonthOnly) {
const dateParts = dateKey.split('-');
const memoYear = parseInt(dateParts[0]);
const memoMonth = parseInt(dateParts[1]);
if (memoYear !== year || memoMonth !== month + 1) {
return;
}
}
memos[dateKey].forEach(memo => {
// 如果只搜索未完成备忘录,检查完成状态
if (searchIncompleteOnly && memo.completed) {
return;
}
// 搜索关键词(不区分大小写)
if (memo.text.toLowerCase().includes(keyword.toLowerCase())) {
searchResults.push({
dateKey: dateKey,
memo: memo,
date: parseDateKey(dateKey)
});
}
});
});
...
附件
html软件,解压浏览器打开即可使用
蓝奏云
https://wwavl.lanzouu.com/iRtMs3fuafed 密码:52pj
https://wwavl.lanzouu.com/iCJXz3fwk9za 密码:52pj 增加明亮模式,增加备忘录内容预览
https://wwavl.lanzouu.com/iNoDb3fx5r7g 密码:52pj 优化明亮日历显示,增加序号和完成删除线预览
https://wwavl.lanzouu.com/ieOVl3g0kglc 密码:52pj 优化数据库版本,提升性能
欢迎试用
|