Browse Source

Pull request #273912: BI-147341 fix:contentFormat未考虑时区问题

Merge in DEC/fineui from ~ZOEY.CHEN/fineui_:feature/x to feature/x

* commit 'f0e91077bb231066fd24345f7eebaa36d5e8a038':
  BI-147341 fix:contentFormat未考虑时区问题
master^2^2
Zoey.Chen-陈泽语 8 months ago
parent
commit
e712b52428
  1. 7
      packages/fineui/src/core/func/alias.js

7
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)) {

Loading…
Cancel
Save