fix(workspace): 使用本地日期生成今日日报

This commit is contained in:
Script Generator
2026-06-26 15:43:31 +08:00
parent 8c3fec221b
commit d9b0236d1c
4 changed files with 23 additions and 3 deletions

View File

@@ -34,6 +34,13 @@ export function formatDate(iso?: string | null): string {
/**
* 格式化为 MM-DD HH:mm紧凑版本地时区
*/
export function formatLocalDate(date: Date = new Date()): string {
const yyyy = date.getFullYear();
const mm = String(date.getMonth() + 1).padStart(2, '0');
const dd = String(date.getDate()).padStart(2, '0');
return `${yyyy}-${mm}-${dd}`;
}
export function formatDateTimeShort(iso?: string | null): string {
if (!iso) return '-';
const d = new Date(iso);