From 132368a17e7648523eb1684e37cd3a2d3f47e1ad Mon Sep 17 00:00:00 2001
From: 赵士淞 <zhaoss@yhzhg.cn>
Date: Mon, 09 Jan 2023 05:07:29 +0000
Subject: [PATCH] Merge branch 'zhaoss' of http://192.168.1.110:5678/r/pms-upgrade into master
---
eladmin-web-master/src/components/Crud/crud.js | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/eladmin-web-master/src/components/Crud/crud.js b/eladmin-web-master/src/components/Crud/crud.js
index 23f6fe4..146cfc8 100644
--- a/eladmin-web-master/src/components/Crud/crud.js
+++ b/eladmin-web-master/src/components/Crud/crud.js
@@ -531,6 +531,20 @@
})
},
/**
+ * 年月格式化
+ * @param {Object} timestamp 时间戳
+ */
+ toMonth(timestamp) {
+ if (timestamp == null) {
+ return
+ } else {
+ const system = new Date(timestamp)
+ const year = system.getFullYear()
+ const month = system.getMonth() + 1 < 10 ? '0' + (system.getMonth() + 1) : system.getMonth() + 1
+ return year + '-' + month
+ }
+ },
+ /**
* 日期格式化
* @param {Object} timestamp 时间戳
*/
--
Gitblit v1.9.3