fix(workspace): 使用本地日期生成今日日报
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user