You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ch...@apache.org on 2020/12/30 04:01:05 UTC
[incubator-dolphinscheduler] branch dev updated: [FIx-4338][UI] Fix
invalid date problem in IE
This is an automated email from the ASF dual-hosted git repository.
chenxingchun pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 394e55e [FIx-4338][UI] Fix invalid date problem in IE
new 45b097f Merge pull request #4339 from chengshiwen/fix-dayjs
394e55e is described below
commit 394e55e01a227bc037c3c4be303ca00fba738e26
Author: chengshiwen <ch...@gmail.com>
AuthorDate: Tue Dec 29 18:45:59 2020 +0800
[FIx-4338][UI] Fix invalid date problem in IE
---
dolphinscheduler-ui/src/js/module/filter/filter.js | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dolphinscheduler-ui/src/js/module/filter/filter.js b/dolphinscheduler-ui/src/js/module/filter/filter.js
index af97cb8..a37b764 100644
--- a/dolphinscheduler-ui/src/js/module/filter/filter.js
+++ b/dolphinscheduler-ui/src/js/module/filter/filter.js
@@ -25,10 +25,20 @@ 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
*/
const filterNull = (value) => {