mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-12-07 02:36:57 +08:00
fix(form): datetime如果设置为时间戳,然后初始值是一个字符串的数字显示不正确
This commit is contained in:
parent
8d55d0cd8d
commit
7e71c070f1
@ -303,7 +303,7 @@ export const datetimeFormatter = (
|
||||
if (v) {
|
||||
let time: string | number;
|
||||
if (['x', 'timestamp'].includes(format)) {
|
||||
time = dayjs(v).valueOf();
|
||||
time = dayjs(Number.isNaN(Number(v)) ? v : Number(v)).valueOf();
|
||||
} else if ((typeof v === 'string' && v.includes('Z')) || v.constructor === Date) {
|
||||
dayjs.extend(utc);
|
||||
// UTC字符串时间或Date对象格式化为北京时间
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user