在帖子编辑器中插入一个可点击的按钮,方便用户选择日期时间,生成相对时间标记。其他用户看到的是相对时间(如"3 天后"),鼠标悬停即可看到浏览器本地时区的精确时间。
Add a button to the post composer for inserting relative timestamps. Other users see a relative time (e.g. "in 3 days") — hover to reveal the exact time in their local timezone.
- Composer toolbar button for inserting timestamps
- Datetime picker dialog for easy selection
- Server-side parsing:
[timestamp]1700000000000[/timestamp]→<time>HTML element - Client-side localization via
toLocaleString() - Relative time rendering compatible with NodeBB's built-in timeago
- i18n support (English / 简体中文)
npm install nodebb-plugin-timestamp
# or via NodeBB ACP plugin manager- While composing a post, click the clock icon in the editor toolbar.
- Select a date and time in the picker dialog.
- A
[timestamp]...[/timestamp]tag is inserted at the cursor position. - After posting, it renders as a relative time. Hover to see the exact time.
NodeBB v4.12.0+
# Install dependencies
pnpm install
# Dev build with watch
pnpm dev
# Production build
pnpm build
# Type check
pnpm typecheck
# Lint
pnpm lintMIT © TASA-Ed Studio

