An Obsidian plugin for inserting date links and opening daily notes using natural language in Simplified or Traditional Chinese.
Type @今天 (today), @下周二 (next Tuesday), or @3天后 (in three days). Every suggestion previews its exact date. Ambiguous expressions such as @周二 offer this, next, and previous week; the link alias preserves your original input. Press Enter to insert a date link, or Shift+Enter for a link without an alias.
Traditional holidays use offline lunar calendar conversion. Spring Festival, Lantern Festival, Dragon Boat Festival, Qixi, Mid-Autumn Festival, Double Ninth Festival, Laba, Lunar New Year's Eve, Qingming and Winter Solstice are supported for Gregorian years 1900–2100. Explicit years produce one result; bare holiday names offer adjacent years. Official vacation schedules and compensatory workdays are not included.
Install from Obsidian Community Plugins by searching for Natural Language Dates - Chinese, or copy main.js and manifest.json from the latest GitHub release into .obsidian/plugins/nldates-chinese/ and enable the plugin. Requires Obsidian 1.12.0 or later.
Settings include date format, week start, trigger character and link output. Commands also support parsing selected text and opening a daily note. Development: npm ci, npm run typecheck, npm run lint, npm test, npm run build.
Obsidian 插件,支持使用中文自然语言输入日期,快速插入日期链接或打开日记。
输入 @ 触发日期建议菜单,或使用命令解析选中的中文日期文本。
同时支持简体中文和繁体中文(如「週五」「下週三」「禮拜一」「勞動節」等)。
支持以下中文日期表达:
输入 @周二 时提供本周二、下周二、上周二;输入 @8号 时提供本月、下月、上月8日。无年份的月日、月初/月中/月末、年初/年末和固定公历节日也提供相邻周期候选,所有候选(包括今天、下周二、3天后等单一结果)都同时展示实际日期。不存在的日期会被省略。
选择候选后,链接别名保留 @ 后的原始输入,例如选择上周二仍插入 [[实际日期|周二]]。Shift+Enter 插入不带别名的链接。传统节日支持离线农历转换:春节、元宵、端午、七夕、中秋、重阳、腊八、除夕,以及清明、冬至。裸节日提供今年、明年、去年候选,明确年份只提供一个结果。年份指节日所在的公历年份,支持1900—2100年;暂不支持调休及放假区间。
| 命令 | 说明 |
|---|---|
| 解析自然语言日期 | 将选中的中文日期替换为 [[日期|别名]] 链接 |
| 解析自然语言日期(纯文本) | 将选中的中文日期替换为纯日期文本 |
| 用自然语言打开日记 | 输入中文日期后跳转到对应日记 |
YYYY-MM-DD@[[]] 中MM月DD日。用于命令等入口;@ 自动建议始终使用原始输入作为别名在 @ 弹出的建议菜单中:
在 Obsidian 社区插件市场搜索「自然语言日期(中文)」安装。
main.js 和 manifest.json.obsidian/plugins/nldates-chinese/ 目录npm install
npm run dev # 开发模式,自动监听文件变化
npm run build # 构建