From cb6086934c46f7ac9f277cbdf1203c8f9f9aaf5f Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 24 三月 2026 08:05:14 +0800
Subject: [PATCH] 1.递交
---
src/utils/global.js | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/src/utils/global.js b/src/utils/global.js
index b121552..cf72a56 100644
--- a/src/utils/global.js
+++ b/src/utils/global.js
@@ -41,6 +41,23 @@
return data.getFullYear() + '-' + month + '-' + date
}
+// 鏃堕棿澶勭悊鍑芥暟 骞存湀鏃� 鏃跺垎绉� 寰�鍓嶆帹涓�澶�
+export function handleDateReduceOneDay(value) {
+ const newDate = new Date(value)
+ newDate.setDate(newDate.getDate() - 1)
+ 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}`
+}
+
// 浜嬩欢澶勭悊鍑芥暟 鏃跺垎绉�
// 鑾峰彇褰撳墠鏃堕棿
export function handleDatetime2(value) {
@@ -57,7 +74,7 @@
const week = weeks[wk]
// return `${y}-${m}-${d} ${hh}:${mm}:${ss} ${week}`
- return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
+ return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
// 鏃堕棿澶勭悊鍑芥暟 杩斿洖 鏃跺垎
--
Gitblit v1.9.3