You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by qi...@apache.org on 2020/09/03 07:03:47 UTC
[skywalking-rocketbot-ui] 01/01: Revert "set dateformat with
timezone (#348)"
This is an automated email from the ASF dual-hosted git repository.
qiuxiafan pushed a commit to branch revert-348-master
in repository https://gitbox.apache.org/repos/asf/skywalking-rocketbot-ui.git
commit 2a84887df6327b0d68de54e8810ef8f6925e0ea6
Author: Qiuxia Fan <fi...@outlook.com>
AuthorDate: Thu Sep 3 15:03:39 2020 +0800
Revert "set dateformat with timezone (#348)"
This reverts commit 8bb656cdae28f7b99a90ccb07646f5830cacc29a.
---
package.json | 2 +-
src/main.ts | 14 +++++---------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/package.json b/package.json
index a766cde..86ef869 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,7 @@
"axios": "^0.18.0",
"d3": "^5.9.1",
"d3-tip": "^0.9.1",
- "dayjs": "^1.8.28",
+ "dayjs": "^1.8.8",
"echarts": "^4.1.0",
"lodash": "^4.17.15",
"noty": "^3.2.0-beta",
diff --git a/src/main.ts b/src/main.ts
index 7bd6f8d..122c2ff 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -17,7 +17,6 @@
import Vue from 'vue';
import moment from 'dayjs';
-import utcPlugin from 'dayjs/plugin/utc';
import clickout from '@/utils/clickout';
import tooltip from '@/utils/tooltip';
import zh from '@/assets/lang/zh';
@@ -47,14 +46,11 @@ Vue.use(VModal, { dialog: true });
Vue.directive('clickout', clickout);
Vue.directive('tooltip', tooltip);
-moment.extend(utcPlugin);
-
-Vue.filter('dateformat', (dataStr: any, pattern: string = 'YYYY-MM-DD HH:mm:ss') => {
- let utc: string = window.localStorage.getItem('utc') || (-(new Date().getTimezoneOffset() / 60)).toString();
- return moment(dataStr)
- .utcOffset(Number(utc) * 60)
- .format(pattern);
-});
+Vue.filter(
+ 'dateformat',
+ (dataStr: any, pattern: string = 'YYYY-MM-DD HH:mm:ss') =>
+ moment(dataStr).format(pattern),
+);
const savedLanguage = window.localStorage.getItem('lang');
let language = navigator.language.split('-')[0];