You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by so...@apache.org on 2022/03/26 11:13:27 UTC

[dolphinscheduler] branch dev updated: [Fix][UI Next][V1.0.0-Alpha] Fix workflow timing timezone display bug (#9202)

This is an automated email from the ASF dual-hosted git repository.

songjian pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new f9e1ca5  [Fix][UI Next][V1.0.0-Alpha] Fix workflow timing timezone display bug (#9202)
f9e1ca5 is described below

commit f9e1ca50e406a106ce1ad5c6b6210fb0ffde02c4
Author: Devosend <de...@gmail.com>
AuthorDate: Sat Mar 26 19:13:14 2022 +0800

    [Fix][UI Next][V1.0.0-Alpha] Fix workflow timing timezone display bug (#9202)
---
 .../views/projects/workflow/definition/timing/use-table.ts  | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts
index c4a4f02..6ba3d78 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts
@@ -38,15 +38,12 @@ import {
 } from '@/utils/column-width-config'
 import { format } from 'date-fns-tz'
 import { ISearchParam } from './types'
-import { useTimezoneStore } from '@/store/timezone/timezone'
 import styles from '../index.module.scss'
 import type { Router } from 'vue-router'
 
 export function useTable() {
   const { t } = useI18n()
   const router: Router = useRouter()
-  const timezoneStore = useTimezoneStore()
-  const timeZone = timezoneStore.getTimezone
 
   const variables = reactive({
     columns: [],
@@ -61,7 +58,11 @@ export function useTable() {
     showRef: ref(false)
   })
 
-  const renderTime = (time: string) => {
+  const renderTime = (time: string, timeZone: string) => {
+    if (!timeZone) {
+      return time
+    }
+
     const utc = format(new Date(time), 'zzz', {
       timeZone
     }).replace('GMT', 'UTC')
@@ -96,13 +97,13 @@ export function useTable() {
         title: t('project.workflow.start_time'),
         key: 'startTime',
         ...COLUMN_WIDTH_CONFIG['time'],
-        render: (row: any) => renderTime(row.startTime)
+        render: (row: any) => renderTime(row.startTime, row.timezoneId)
       },
       {
         title: t('project.workflow.end_time'),
         key: 'endTime',
         ...COLUMN_WIDTH_CONFIG['time'],
-        render: (row: any) => renderTime(row.endTime)
+        render: (row: any) => renderTime(row.endTime, row.timezoneId)
       },
       {
         title: t('project.workflow.crontab'),