mirror of
https://gitee.com/dolphinscheduler/DolphinScheduler.git
synced 2024-12-01 03:37:46 +08:00
[FIx-4338][UI] Fix invalid date problem in IE
This commit is contained in:
parent
806e8d9b60
commit
394e55e01a
@ -25,9 +25,19 @@ const formatDate = (value, fmt) => {
|
||||
if (value === null) {
|
||||
return '-'
|
||||
} else {
|
||||
return dayjs(value).format(fmt)
|
||||
return dayjs(formatISODate(value)).format(fmt)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Formatting iso date
|
||||
*/
|
||||
const formatISODate = date => {
|
||||
let [datetime, timezone] = date.split('+')
|
||||
if (!timezone || timezone.indexOf(':') >= 0) return date
|
||||
let hourOfTz = timezone.substring(0, 2) || '00'
|
||||
let secondOfTz = timezone.substring(2, 4) || '00'
|
||||
return `${datetime}+${hourOfTz}:${secondOfTz}`
|
||||
}
|
||||
/**
|
||||
* filter null
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user