From deb42cf1c3b3fc80c579b140939bc459d4262604 Mon Sep 17 00:00:00 2001
From: luoyb <412940104@qq.com>
Date: 星期六, 06 三月 2021 12:30:25 +0800
Subject: [PATCH] fix(bug修复): 在职员工录入身份证校验
---
src/utils/myUtil.js | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/utils/myUtil.js b/src/utils/myUtil.js
index 029e96f..586cb27 100644
--- a/src/utils/myUtil.js
+++ b/src/utils/myUtil.js
@@ -53,6 +53,13 @@
return age
}
+/**
+ * 计算日期时间间隔
+ * @param begin 起始时间
+ * @param end 结束时间
+ * @param flag 间隔单位
+ * @returns {*}
+ */
export function dateDifference(begin, end, flag) {
let dateSpan
let iReturn
@@ -70,3 +77,11 @@
}
return iReturn
}
+
+export function dateToString(val) {
+ val = new Date(val)
+ const year = val.getFullYear()
+ const month = val.getMonth() + 1
+ const day = val.getDate()
+ return year + '-' + month + '-' + day
+}
--
Gitblit v1.8.0