From 71d2e42ae642cecb5e8f6776c702cd20bafe6c01 Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期二, 27 八月 2024 17:12:04 +0800
Subject: [PATCH] 打卡

---
 src/common/utils/util.js |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/common/utils/util.js b/src/common/utils/util.js
index 0d4f51e..15c3344 100644
--- a/src/common/utils/util.js
+++ b/src/common/utils/util.js
@@ -133,6 +133,19 @@
 			parseInt(t[2], 10) || null
 		)).getTime() / 1000;
 	},
+	formatDate(dat, type) {
+		let date = new Date(dat)
+		console.log(date, dat, type);
+		const year = date.getFullYear();
+		const month = (date.getMonth() + 1).toString().padStart(2, '0');
+		const day = date.getDate().toString().padStart(2, '0');
+		const hours = date.getHours().toString().padStart(2, '0');
+		const minutes = date.getMinutes().toString().padStart(2, '0');
+		if (type) {
+			return `${year}-${month}-${day} ${hours}:${minutes}`;
+		}
+		return `${year}-${month}-${day}`;
+	},
 	/**
 	 * 鍊掕鏃�
 	 * @param {Object} seconds 绉�
@@ -697,4 +710,4 @@
 		typeof callback == 'function' && callback(theRequest);
 	}
 
-}
+}
\ No newline at end of file

--
Gitblit v1.9.1