duany190 downloadsCount down to anniversaries, birthdays, and recurring events, with Chinese lunar dates, zodiac signs, and Chinese zodiac animals, all stored in a plain Markdown note.
最省事的一条路:直接在 Obsidian 里装。 设置 → 第三方插件 → 浏览,搜索「Important Days」→ 安装 → 启用。插件进入官方社区目录后,之后的更新也在这个页面点一下就能拿到。
从社区目录安装时,客户端只逐个下载 Release 里的
main.js、manifest.json、styles.css三份文件。这个插件完全不联网,也没有需要另行下载的数据文件——数据就是你自己库里的一个 Markdown 笔记。
想手动装(比如所在网络打不开社区插件浏览器):
important-days-<版本号>.zipimportant-days.obsidian/plugins/(如果没见过这个目录:在 Obsidian 里点左下角仓库图标 →「在系统资源管理器中显示仓库」,进去就能看到 .obsidian)important-days 文件夹整个放进去,变成 .obsidian/plugins/important-days/(里面应有 main.js、manifest.json、styles.css)进阶:也可以安装 BRAT 插件,添加仓库地址
https://github.com/duany2026/important-days,以后可自动更新。
记录生活中的重要日子:纪念日、生日、周期事件。支持倒计时、农历公历互转、属相星座显示,适配桌面端和移动端。
English speakers: see the English section below for installation, usage, the data file format, and privacy details.
设置 → 第三方插件 → 浏览,搜索「Important Days」,安装后启用。更新也在同一页点一下即可。
important-days 文件夹复制到 vault 的 .obsidian/plugins/ 目录插件数据保存在一个 Markdown 文件中(默认自动扫描,也可在插件设置中手动指定/重新扫描):
# 重要日子
## 纪念日
- 结婚纪念日 | 2023-05-20
- 恋爱纪念日 | 2020-02-14
## 生日
- 妈妈生日 | 1965-08-15
- 奶奶生日 | 1940-12-08 | 农历
- 闰月生日 | 1984-10-05 | 农历闰
## 周期事件
- 交房租 | 每月 15
- 季度考核 | 每季度 3-15
- 年检 | 每年 05-20
- 例会 | 每周 5
数据文件格式说明:
## 二级标题区分(纪念日 / 生日 / 周期事件)YYYY-M-D,支持不补零农历 表示农历日期,农历闰 表示闰月生日每月 N / 每季度 M-D(M 为季度内月份 1-3)/ 每年 MM-DD / 每周 N(N 为 1-7,周一至周日)设置页只有一个「数据文件」分区,两行:
| 设置 | 说明 |
|---|---|
| 文件路径 | 数据文件的库内路径(如 笔记/重要日子.md)。失焦或回车才提交,敲字过程中不会改配置;不以 .md 结尾会弹提示并保留原值。文件不存在时,添加日子会自动创建 |
| 自动扫描 | 按「# 重要日子」这个一级标题在库里找数据文件,找到多个时用第一个并提示其余候选。扫描换了文件,上面的路径框会跟着更新 |
其余使用说明都在本文档里:编辑方式见「使用」,手编格式与冲突保护见「数据文件」,14 天内倒计时高亮见「功能特性」。
>= 0.15.0插件完全不联网:源码里没有任何网络请求,农历换算、属相与星座全部由随 main.js 分发的本地算法与数据表算出。
data.json 设置)Important Days tracks anniversaries, birthdays, and recurring events in a single plain Markdown note inside your vault. It shows countdowns, anniversary counts, ages, Chinese zodiac animals, and zodiac signs, and converts between Chinese lunar and solar dates. The interface follows Obsidian's theme (light and dark) and works on desktop, phones, and tablets.
From the community directory: Settings → Community plugins → Browse, search for "Important Days", install, then enable.
Manual installation:
important-days-<version>.zip from the Releases page.important-days containing main.js, manifest.json, and styles.css..obsidian/plugins/ directory, so you end up with .obsidian/plugins/important-days/.You can also install BRAT and add the repository https://github.com/duany2026/important-days to get updates automatically.
The plugin is listed as "Important Days" in the community browser, the installed-plugin list, and the settings sidebar, because those three places render the name from manifest.json. The view title, the ribbon tooltip, and the command palette entry stay in Chinese ("重要日子").
# 重要日子.Events falling within the next 14 days are highlighted, and the view refreshes itself when the date rolls over at midnight.
Every entry lives in one Markdown note. By default the plugin scans the vault for a note whose H1 is # 重要日子; you can also point it at a path manually in the settings.
# 重要日子
## 纪念日
- 结婚纪念日 | 2023-05-20
## 生日
- 妈妈生日 | 1965-08-15
- 奶奶生日 | 1940-12-08 | 农历
- 闰月生日 | 1984-10-05 | 农历闰
## 周期事件
- 交房租 | 每月 15
- 季度考核 | 每季度 3-15
- 年检 | 每年 05-20
- 例会 | 每周 5
The headings and the lunar markers are Chinese because the parser matches them literally. Entry names can be in any language.
## heading selects the type: 纪念日 (anniversary), 生日 (birthday), 周期事件 (recurring event).YYYY-M-D; leading zeros are optional.农历 on a birthday means the date is lunar; 农历闰 means a leap-month birthday. If that lunar year has no such leap month, the regular month is used instead.每月 N (monthly), 每季度 M-D (quarterly, where M is 1-3), 每年 MM-DD (yearly), 每周 N (weekly, where N is 1-7, Monday to Sunday). A day number beyond the month's length is clamped to the last day.| Setting | Description |
|---|---|
| 文件路径 (File path) | Vault-relative path to the data note, e.g. 笔记/重要日子.md. Committed on blur or Enter, not on every keystroke. A value that does not end in .md is rejected with a notice and the previous value is kept. The note is created automatically when you add a day. |
| 自动扫描 (Auto scan) | Finds the data note by its # 重要日子 H1. When several notes match, the first is used and the others are reported. The path field updates to whatever the scan picked. |
The plugin makes no network requests at all. Lunar conversion, Chinese zodiac animals, and zodiac signs are computed locally from tables shipped inside main.js.
data.json settings file.>= 0.15.0isDesktopOnly: false)MIT — see LICENSE. Author: duany.
上架社区目录的合规改造 + 设置页重做 + 视图铺满宽度。编辑弹窗、农历换算、属相星座的视觉与行为均未改动;变的是设置页形状、卡片列表的排布宽度、插件在宿主里的显示名,以及发布链路。
SettingGroup(1.11+)+ Setting.setHeading() 回退,minAppVersion 仍是 0.15.0;去掉自绘的「重要日子设置」h2,只留一个「数据文件」分区、两行「文件路径」与「自动扫描」display() 重绘换掉按钮,现用 try/finally 复位.id-settings-tips 样式max-width:800px 与 margin:0 auto 硬上限,改为铺满可用宽度。原来在 1200px 宽的标签页里左右各空 200px;内边距也从「宿主 12px + 容器 20px」双层叠成 32px 收为单层,按官方核心视图(pdf / bases / backlink)同一口径把宿主 .view-content 的 padding 与 overflow 收掉,只留内部一个滚动区。容器自身补 overflow-y:auto 兜底:数据文件不存在的空态直接挂在容器上、不在卡片滚动区里,宿主收成 overflow:hidden 后矮窗口靠它滚到底,不会被裁掉够不着display:grid 却没写 grid-template-columns,等于单列竖堆,内容一高就出滚动条。改为 repeat(auto-fill, minmax(280px, 1fr)) 按容器宽度自动分列——宽标签页多列铺满,窄侧栏与手机自然退回一列;auto-fill 量的是容器而非视口,所以桌面右侧栏不会误触发手机断点。同时补 align-content:start,卡片少时不再被拉伸填满整屏高度--scrollbar-native-width: none 配 ::-webkit-scrollbar{display:none},核心里六处在用),滚动本身保留,滚轮与触摸照常;内容超出时只是不再显示那根条manifest.json 的 name 改为英文 Important Days(官方要求 Basic Latin,非 ASCII 名会被除名),description 改为英文动作陈述、166 字符、句号结尾,补 authorUrl。宿主渲染的三处(社区插件浏览器、已安装列表、设置侧栏)随之显示英文名;应用内视图标题、心形图标提示与命令仍是中文「重要日子」open-important-days → open-view(Obsidian 会自动加插件 ID 前缀);命令面板里显示的名字不变styles.css(官方 ESLint 规则 no-static-styles-assignment 判 error),闰月行的显隐改走 is-visible 类;新选择器的特异性一律压过既有规则、不靠加载顺序取胜,渲染结果不变。留下的 6 处 .style 写入都是真动态值(等高卡片的 minHeight、按类型切换的三元显隐)document.createElement 改 activeDocument.createElement(弹出窗口里才会建到正确的文档)、13 处裸定时器补 window. 前缀、3 处未用的 catch (e) 改 catch {}、删未用变量main.js 分发的本地算法与数据表算出;「发布打包」一节按新工作流重写;下载步骤不再写死版本号manifest.json 的 version 且不带 v 前缀;新增版本号三段式、versions.json 已登记、node --check main.js 三道闸门;发行版上传 main.js/manifest.json/styles.css 三份独立附件 + 手动安装 ZIP——旧工作流只传 ZIP,而 Obsidian 是逐个下载那三份、不认 ZIP 的,所以旧发行版即便标签对了从目录也装不上;三份文件另加 actions/attest 构建来源证明.gitignore,排除 data.json 与本地打包产物aria-label(添加按钮为纯 CSS 图形,读屏器此前无可访问名称)containerEl,改用自有字段 rootEl;styles.css 大面积重复规则去重(保持现有渲染效果不变,移除 !important 与永不生效的渐变/阴影块);移除构建产物注释标记,明确 main.js 为唯一源码authorUrl/fundingUrl 字段## 小节(如自建「待办事项」)继承上一小节类型,其中形似条目的行变成幽灵卡片、删除即误删用户内容role/aria-modal 并自动聚焦保存按钮MIT License
作者:duany
仓库根目录即插件目录,main.js 就是唯一源码,没有构建步骤。.github/workflows/release.yml 由推送 tag 触发,tag 必须与 manifest.json 里的 version 逐字相同、不带 v 前缀——社区目录是按「tag == manifest.version」去找发行版的,带 v 的 tag 它认不到(本仓库早期的 v1.4.0、v1.4.1 就属于这种)。工作流先拦下不合格的 tag,再校验版本号是 x.y.z 三段式、versions.json 已登记该版本、node --check main.js 通过。
发行版上传四个附件:main.js、manifest.json、styles.css 三份独立文件,外加手动安装用的 important-days-<版本号>.zip。三份独立附件是必须的——从社区目录安装时 Obsidian 只逐个下载这三份,ZIP 它不认;versions.json、README.md、LICENSE 只进 ZIP。那三份文件另有 actions/attest 生成的构建来源证明。
ZIP 内逐个点名上述六个文件,不含 data.json——其中存有作者本机的数据文件路径设置,会让新用户首次启动时跳过自动扫描,并指向一个他们库里不存在的文件。.gitignore 也已排除它。
发版前版本号要对齐四处:manifest.json、versions.json(新增一行,值是该版本要求的 minAppVersion)、main.js 头部注释、本文「版本记录」新增 ### <版本号>(日期) 一节——发行说明就是从这一节提取的,漏写会退回一句只有版本号的占位说明。
发布令牌:工作流先试仓库 Secret RELEASE_TOKEN,用它发布时发行版页面的发布人是令牌属主;该 Secret 缺失或已过期时自动退回内置 GITHUB_TOKEN,发布人显示为 github-actions[bot]。