mirror of
https://github.com/fawney19/Aether.git
synced 2026-01-05 09:12:27 +08:00
refactor(frontend): 优化工具函数和 mock handler
- 更新 format.ts 工具函数 - 调整 mock handler 和 useDateRange composable
This commit is contained in:
@@ -47,7 +47,7 @@ export function getDateRangeFromPeriod(period: PeriodValue): DateRangeParams {
|
||||
*/
|
||||
export function formatDateTime(dateStr: string): string {
|
||||
// 后端返回的是 UTC 时间但没有时区标识,需要手动添加 'Z'
|
||||
const utcDateStr = dateStr.includes('Z') || dateStr.includes('+') ? dateStr : dateStr + 'Z'
|
||||
const utcDateStr = dateStr.includes('Z') || dateStr.includes('+') ? dateStr : `${dateStr }Z`
|
||||
const date = new Date(utcDateStr)
|
||||
|
||||
// 只显示时分秒
|
||||
|
||||
Reference in New Issue
Block a user