评论编辑器改为紧凑底栏与精简工具栏,评论操作收进更多菜单。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-21 00:56:53 +08:00
parent c0462a3500
commit acde7ee288
4 changed files with 1182 additions and 526 deletions

View File

@@ -54,3 +54,12 @@ export function formatDateTime(dateStr: string): string {
if (Number.isNaN(d.getTime())) return "";
return `${formatDate(dateStr)} ${pad2(d.getHours())}:${pad2(d.getMinutes())}:${pad2(d.getSeconds())}`;
}
/** 评论列表短时间:同年「M月D日 HH:mm」,跨年补年份。悬停用 formatDateTime。 */
export function formatCommentTime(dateStr: string, now = new Date()): string {
const d = new Date(dateStr);
if (Number.isNaN(d.getTime())) return "";
const hm = `${pad2(d.getHours())}:${pad2(d.getMinutes())}`;
const md = `${d.getMonth() + 1}月${d.getDate()}日 ${hm}`;
return d.getFullYear() === now.getFullYear() ? md : `${d.getFullYear()}年${md}`;
}