by leoray
Insert dates from quick shortcuts or a keyboard-friendly calendar while editing a note.
Quick Date Entry
Insert a date without leaving the Markdown editor. Type @ or your own trigger to open a calendar and see the exact text that will be inserted. Use the arrow keys, letter shortcuts, or a mouse to select a date.
Quick start
- Press Enter to insert the highlighted date. Space shows letter shortcuts. Shift + Left/Right changes the month, Shift + Up/Down changes the format, and Esc closes the picker.
- Choose which dates appear and drag them into one order. Mix built-in dates with relative days, weekdays, fixed dates, or Moment formulas such as
moment().add(1, "month").endOf("month"). - Pick a default format and define additional formats in the plugin settings. The interface supports English and Chinese.
The plugin works offline and stores its settings in the current vault.
Installation
For a manual install, download main.js, manifest.json, and styles.css from the latest GitHub release. Put the three files in .obsidian/plugins/quick-date-entry/ in your vault, then enable Quick Date Entry under Settings → Community plugins.
中文使用说明
在 Obsidian 的 Markdown 编辑器中输入 @,即可在光标旁选择日期。弹窗顶部会预览当前日期的插入文字,确认后用预览中的日期替换触发字符,光标回到编辑器。日历以周一为一周的第一天,支持源码模式和实时预览。
安装
- 从 GitHub Release 下载
main.js、manifest.json和styles.css,放入目标库的.obsidian/plugins/quick-date-entry/。 - 在 Obsidian 的「设置 → 第三方插件」中刷新插件列表并启用 Quick Date Entry。
- 在插件设置中可以更换触发字符,例如
!或@,也可选择中文、English 或跟随 Obsidian。常用日期和日历可分别关闭,两者都关闭时,输入触发字符会和普通输入一样。
日期格式
- 在插件设置中修改「日期格式」。默认使用
YYYY-MM-DD,可以填写YYYY/MM/DD、YYYY年M月D日或其他 Moment 格式。设置页会实时预览今天的日期。 - 「弹窗可选格式」每行填写一种格式,可添加、删除或调整顺序。留空时只使用默认格式,弹窗隐藏格式切换按钮。
- 点击弹窗右上角的「格式」按钮,或用方向键移到按钮后按 Enter,可在默认格式和自定义列表间循环。切换即时更新预览,只对当前弹窗生效。
常用日期
- 在设置的「常用日期排序」中选择弹窗显示哪些日期。内置和自定义日期可在同一列表拖拽排序,也可聚焦拖拽手柄后用上下键移动。弹窗按设置中的顺序显示。
- 点击「添加日期」新增选项,可选择相对天数、指定星期、固定日期或「高级 Moment 公式」。已启用的前 14 个自定义日期可用字母键,其他自定义日期可用方向键选中。
高级公式以 moment() 或指定起始日期的 moment(...) 开始,支持常用的日期链式操作,包括 add、subtract、startOf、endOf、set、day、isoWeekday、week、month 和 year。设置页会预览计算结果。
| 日期 | 公式 |
|---|---|
| 下个月最后一天 | moment().add(1, "month").endOf("month") |
| 两周后的周五 | moment().add(2, "weeks").isoWeekday(5) |
| 下季度第 15 天 | moment().add(1, "quarter").startOf("quarter").add(14, "days") |
| 指定日期再加 3 天 | moment("2026-12-31").add(3, "days") |
更多用法见 Moment.js 日期操作文档。
键盘操作
- 输入触发字符后,高亮「今天」。仅开启日历时,高亮日历中当天的日期。编辑器保留原来的光标。
- 方向键在日期和月份按钮之间移动,Enter 确认。日历中左右键移动一天,跨月时自动翻页。
- Shift + ← / → 切换月份,尽量保留同一日。Shift + ↑ / ↓ 切换上一个或下一个日期格式。这两组快捷键可在设置中分别关闭。
- 按 Tab 保持弹窗和当前选项。
- 日历标题旁的「今天」按钮会回到本月,并将焦点移到今天。
- 空格开启或关闭字母快捷键模式。开启后,以下按钮右上角显示字母,按对应字母即可执行。
- Esc 关闭弹窗,保留已经输入的触发字符。
- 底部一次显示一条键盘提示。按右箭头按钮查看下一条,关闭最后一条后,该笔记库以后不再显示提示区。所有提示仍可在设置页查看。
| 按键 | 操作 | 按键 | 操作 |
|---|---|---|---|
| Q | 今天 | A | 昨天 |
| W | 明天 | S | 前天 |
| E | 后天 | D | 本周一 |
| R | 下周一 | F | 本周五 |
| J | 上个月 | K | 下个月 |
| H | 切换日期格式 | L | 回到今天 |
Build / 构建
npm ci
npm run build
License
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.