This is an automated email from the ASF dual-hosted git repository.
wenhemin pushed a commit to branch 1.3.7-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/1.3.7-prepare by this push:
new e5c4be3 [1.3.7-prepare][Fix-5467][UI] Fix UI cannot be displayed
normally in some browsers (#5914)
e5c4be3 is described below
commit e5c4be3ca625a7064d1a0546da6bc199700c3848
Author: Shiwen Cheng <[email protected]>
AuthorDate: Mon Aug 2 13:47:58 2021 +0800
[1.3.7-prepare][Fix-5467][UI] Fix UI cannot be displayed normally in some
browsers (#5914)
* [Fix-4335][UI] Fix IE 9-11 not supported #4336
* [FIx-4338][UI] Fix invalid date problem in IE #4339
---
dolphinscheduler-ui/.babelrc | 10 +++++++++-
dolphinscheduler-ui/build/config.js | 2 +-
dolphinscheduler-ui/package.json | 12 +++++++++++-
dolphinscheduler-ui/src/js/conf/home/index.js | 1 +
dolphinscheduler-ui/src/js/conf/login/index.js | 1 +
dolphinscheduler-ui/src/js/module/filter/filter.js | 12 +++++++++++-
6 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/dolphinscheduler-ui/.babelrc b/dolphinscheduler-ui/.babelrc
index aeb5ba2..613d2cd 100644
--- a/dolphinscheduler-ui/.babelrc
+++ b/dolphinscheduler-ui/.babelrc
@@ -5,7 +5,15 @@
"debug": false,
"useBuiltIns": true,
"targets": {
- "browsers": [ "ie > 8", "last 2 version", "safari >= 9" ]
+ "browsers": [
+ "> 1%",
+ "last 2 versions",
+ "ie >= 10",
+ "edge >= 12",
+ "firefox >= 28",
+ "chrome >= 29",
+ "opera >= 17"
+ ]
},
"production": {
"plugins": ["transform-remove-console"]
diff --git a/dolphinscheduler-ui/build/config.js
b/dolphinscheduler-ui/build/config.js
index 53a421d..619b09f 100644
--- a/dolphinscheduler-ui/build/config.js
+++ b/dolphinscheduler-ui/build/config.js
@@ -47,7 +47,7 @@ const jsEntry = (() => {
parts.shift()
let modules = parts.join('/')
let entry = moduleName(modules)
- obj[entry] = val
+ obj[entry] = ['babel-polyfill', val]
})
return obj
})()
diff --git a/dolphinscheduler-ui/package.json b/dolphinscheduler-ui/package.json
index 607cde0..44c927f 100644
--- a/dolphinscheduler-ui/package.json
+++ b/dolphinscheduler-ui/package.json
@@ -47,6 +47,7 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
+ "babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"copy-webpack-plugin": "^4.5.2",
"cross-env": "^5.2.0",
@@ -79,5 +80,14 @@
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.9.0",
"webpack-merge": "^4.2.2"
- }
+ },
+ "browserslist": [
+ "> 1%",
+ "last 2 versions",
+ "ie >= 10",
+ "edge >= 12",
+ "firefox >= 28",
+ "chrome >= 29",
+ "opera >= 17"
+ ]
}
diff --git a/dolphinscheduler-ui/src/js/conf/home/index.js
b/dolphinscheduler-ui/src/js/conf/home/index.js
index efec218..7c5dda0 100644
--- a/dolphinscheduler-ui/src/js/conf/home/index.js
+++ b/dolphinscheduler-ui/src/js/conf/home/index.js
@@ -17,6 +17,7 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an
alias.
+import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import router from './router'
diff --git a/dolphinscheduler-ui/src/js/conf/login/index.js
b/dolphinscheduler-ui/src/js/conf/login/index.js
index d9b9353..edcf555 100644
--- a/dolphinscheduler-ui/src/js/conf/login/index.js
+++ b/dolphinscheduler-ui/src/js/conf/login/index.js
@@ -18,6 +18,7 @@
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an
alias.
// import $ from 'jquery'
+import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import i18n from '@/module/i18n'
diff --git a/dolphinscheduler-ui/src/js/module/filter/filter.js
b/dolphinscheduler-ui/src/js/module/filter/filter.js
index 827b9e3..d8278b8 100644
--- a/dolphinscheduler-ui/src/js/module/filter/filter.js
+++ b/dolphinscheduler-ui/src/js/module/filter/filter.js
@@ -22,7 +22,17 @@ import dayjs from 'dayjs'
*/
const formatDate = (value, fmt) => {
fmt = fmt || 'YYYY-MM-DD HH:mm:ss'
- 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}`
}
export {