From d6f69af30f85add247d5e7e2ee8a9c1b7368d6cf Mon Sep 17 00:00:00 2001
From: Alan <1124498879@qq.com>
Date: 星期六, 20 二月 2021 12:02:18 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/utils/myUtil.js | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/utils/myUtil.js b/src/utils/myUtil.js
index 0c956e4..6a3d908 100644
--- a/src/utils/myUtil.js
+++ b/src/utils/myUtil.js
@@ -29,6 +29,7 @@
}
return { birth: birth, sex: sex, age: age }
}
+
/**
* 计算工龄
* @param {*} entryDate 入职日期
@@ -51,3 +52,18 @@
}
return age
}
+
+export function dateDifference(begin, end, flag) {
+ let dateSpan
+ let iReturn
+ begin = Date.parse(begin)
+ end = Date.parse(end)
+ dateSpan = end - begin
+ dateSpan = Math.abs(dateSpan)
+ switch (flag) {
+ case 'd':
+ iReturn = Math.floor(dateSpan / (24 * 3600 * 1000))
+ break
+ }
+ return iReturn
+}
--
Gitblit v1.8.0