From 4fbd0c98d22c2ce6eabfcb507c13c6c9ce77492d Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 21 一月 2026 14:22:55 +0800
Subject: [PATCH] 1.递交
---
src/utils/global.js | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/utils/global.js b/src/utils/global.js
index 19b4ea7..6669882 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -41,14 +41,21 @@
return data.getFullYear() + '-' + month + '-' + date
}
-// 鏃堕棿澶勭悊鍑芥暟 骞存湀鏃� 寰�鍓嶆帹涓�澶�
+// 鏃堕棿澶勭悊鍑芥暟 骞存湀鏃� 鏃跺垎绉� 寰�鍓嶆帹涓�澶�
export function handleDateReduceOneDay(value) {
const newDate = new Date(value)
newDate.setDate(newDate.getDate() - 1)
- const data = new Date(newDate)
- const month = data.getMonth() < 9 ? '0' + (data.getMonth() + 1) : data.getMonth() + 1
- const date = data.getDate() <= 9 ? '0' + data.getDate() : data.getDate()
- return data.getFullYear() + '-' + month + '-' + date
+ const dt = new Date(newDate)
+ const wk = dt.getDay()
+ const y = dt.getFullYear()
+ const m = (dt.getMonth() + 1 + '').padStart(2, '0')
+ const d = (dt.getDate() + '').padStart(2, '0')
+
+ const hh = (dt.getHours() + '').padStart(2, '0')
+ const mm = (dt.getMinutes() + '').padStart(2, '0')
+ const ss = (dt.getSeconds() + '').padStart(2, '0')
+
+ return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
// 浜嬩欢澶勭悊鍑芥暟 鏃跺垎绉�
--
Gitblit v1.9.3