From 33722f91c3b9aca371201c9a713c0fc6aa4c940e Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 13 八月 2025 18:15:09 +0800
Subject: [PATCH] 出战汇报单bug处理
---
utils/getdateTime.js | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/utils/getdateTime.js b/utils/getdateTime.js
index 1a1fba9..686e9f4 100644
--- a/utils/getdateTime.js
+++ b/utils/getdateTime.js
@@ -123,9 +123,22 @@
return `${newYYYY}-${newMM}-${newDD} ${newHH}:${newMin}`;
}
+/** 灏嗘椂闂磋浆鎹㈡垚 YYYY-MM-DD HH:MM鏍煎紡
+ * @param {Object} date 鏃堕棿
+ */
+function formatDate(date) {
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const day = String(date.getDate()).padStart(2, '0');
+ const hours = String(date.getHours()).padStart(2, '0');
+ const minutes = String(date.getMinutes()).padStart(2, '0');
+
+ return `${year}-${month}-${day} ${hours}:${minutes}`;
+}
module.exports = {
dateTimeStr: dateTimeStr,
dateTimeSetHoureStr:dateTimeSetHoureStr,
calculateHoursDiff:calculateHoursDiff,
addHoursToDate:addHoursToDate,
+ formatDate:formatDate,
}
\ No newline at end of file
--
Gitblit v1.9.1