From f0e91077bb231066fd24345f7eebaa36d5e8a038 Mon Sep 17 00:00:00 2001 From: chenzeyu Date: Fri, 19 Apr 2024 15:49:15 +0800 Subject: [PATCH] =?UTF-8?q?BI-147341=20fix=EF=BC=9AcontentFormat=E6=9C=AA?= =?UTF-8?q?=E8=80=83=E8=99=91=E6=97=B6=E5=8C=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/func/alias.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/fineui/src/core/func/alias.js b/packages/fineui/src/core/func/alias.js index fc0eaa772..94f12a814 100644 --- a/packages/fineui/src/core/func/alias.js +++ b/packages/fineui/src/core/func/alias.js @@ -9,7 +9,8 @@ import { leftPad, parseDateTime, values, - isArray + isArray, + getDate } from "../2.base"; import { replaceAll } from "./string"; import { getFullDayName, getMonthName, getTimezone } from "./date"; @@ -680,10 +681,10 @@ export const contentFormat = function(cv, fmt) { if (!(cv instanceof Date)) { if (typeof cv === "number") { // 毫秒数类型 - cv = new Date(cv); + cv = getDate(cv); } else { // 字符串类型转化为date类型 - cv = new Date(Date.parse((`${cv}`).replace(/-|\./g, "/"))); + cv = getDate(Date.parse((`${cv}`).replace(/-|\./g, "/"))); } } if (!isInvalidDate(cv) && !isNull(cv)) {