Browse Source

Merge pull request #4339 from chengshiwen/fix-dayjs

[FIx-4338][UI] Fix invalid date problem in IE
pull/3/MERGE
xingchun-chen 4 years ago committed by GitHub
parent
commit
45b097f378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      dolphinscheduler-ui/src/js/module/filter/filter.js

12
dolphinscheduler-ui/src/js/module/filter/filter.js

@ -25,9 +25,19 @@ const formatDate = (value, fmt) => {
if (value === null) { if (value === null) {
return '-' return '-'
} else { } 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 * filter null
*/ */

Loading…
Cancel
Save