From 09da100729793848bc01b51f7b05ca3f1e7ec64f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 20 六月 2024 14:05:35 +0800
Subject: [PATCH] 提交一把
---
company/src/utils/util.js | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/company/src/utils/util.js b/company/src/utils/util.js
index 2677347..2cbb86d 100644
--- a/company/src/utils/util.js
+++ b/company/src/utils/util.js
@@ -67,3 +67,32 @@
return age;
}
+// 鑾峰彇褰撳墠鏃ユ湡
+export function getDate() {
+ let currentDate = new Date();
+ let year = currentDate.getFullYear(); // 鑾峰彇褰撳墠骞翠唤
+ let month = currentDate.getMonth() + 1; // 鑾峰彇褰撳墠鏈堜唤锛屾敞鎰忔湀浠戒粠0寮�濮嬶紝鎵�浠ヨ鍔�1
+ let day = currentDate.getDate(); // 鑾峰彇褰撳墠鏃ユ湡
+ return `${year}-${month}-${day}`
+}
+
+// 瀵规瘮鏃ユ湡
+export function compareDates(date1, date2) {
+ if (new Date(date1).getTime() > new Date(date2).getTime()) {
+ return 1
+ } else if (new Date(date1).getTime() < new Date(date2).getTime()) {
+ return 2
+ } else {
+ return 3
+ }
+}
+
+// 鑾峰彇鏄庡ぉ鐨勬棩鏈�
+export function getTomorrow() {
+ var today = new Date();
+ today.setDate(today.getDate() + 1);
+ var year = today.getFullYear();
+ var month = today.getMonth() + 1;
+ var day = today.getDate();
+ return year + "-" + month + "-" + day;
+}
--
Gitblit v1.9.3