From 707512d5519e701ddcaf0912a768929998e22e58 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 28 十月 2026 15:27:23 +0800
Subject: [PATCH] fix(date): 页面展示的时间统一只到年月日
---
src/utils/index.js | 18 ++----------------
1 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/src/utils/index.js b/src/utils/index.js
index 809593f..5e99216 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -1,25 +1,11 @@
import { parseTime } from "./ruoyi";
/**
- * 琛ㄦ牸鏃堕棿鏍煎紡鍖�
+ * 琛ㄦ牸鏃堕棿鏍煎紡鍖栵紙椤甸潰灞曠ず鍙繚鐣欏勾鏈堟棩锛�
*/
export function formatDate(cellValue) {
if (cellValue == null || cellValue == "") return "";
- var date = new Date(cellValue);
- var year = date.getFullYear();
- var month =
- date.getMonth() + 1 < 10
- ? "0" + (date.getMonth() + 1)
- : date.getMonth() + 1;
- var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
- var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
- var minutes =
- date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
- var seconds =
- date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
- return (
- year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds
- );
+ return parseTime(cellValue, "{y}-{m}-{d}");
}
/**
--
Gitblit v1.9.3