From c0b39bf898fefc84189c45cde1026c0360f5178c Mon Sep 17 00:00:00 2001 From: Onat <53895969+onattech@users.noreply.github.com> Date: Sun, 13 Mar 2022 18:15:07 +0300 Subject: [PATCH] Changed seconds schedule to UTC timezone --- .../CustomNodesContent/ScheduleNode/index.jsx | 10 +++++++++- .../components/DrawerContent/SchedulerDrawer/index.jsx | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/CustomNodesContent/ScheduleNode/index.jsx b/frontend/src/components/CustomNodesContent/ScheduleNode/index.jsx index 18af83b41..c777c09b9 100644 --- a/frontend/src/components/CustomNodesContent/ScheduleNode/index.jsx +++ b/frontend/src/components/CustomNodesContent/ScheduleNode/index.jsx @@ -79,7 +79,7 @@ const ScheduleNode = (props) => { - {props.data.genericdata.timezone + ' ' + getTimeZoneOffSet(props.data.genericdata.timezone)} + {printTimezone(props.data.genericdata.timezone)} @@ -99,3 +99,11 @@ const ScheduleNode = (props) => { }; export default ScheduleNode; + +// Utility function +function printTimezone(timezone) { + if (timezone === 'Etc/UTC') { + return 'UTC'; + } + return timezone + ' ' + getTimeZoneOffSet(timezone); +} diff --git a/frontend/src/components/DrawerContent/SchedulerDrawer/index.jsx b/frontend/src/components/DrawerContent/SchedulerDrawer/index.jsx index ca40fd207..3306aa672 100644 --- a/frontend/src/components/DrawerContent/SchedulerDrawer/index.jsx +++ b/frontend/src/components/DrawerContent/SchedulerDrawer/index.jsx @@ -62,7 +62,7 @@ const ScheduleDrawer = ({ handleClose, setElements }) => { genericdata: { schedule: tabValue ? '*/' + seconds + ' * * * * *' : scheduleStatement, scheduleType: tabValue ? 'cronseconds' : 'cron', - timezone: timezone, + timezone: tabValue ? 'Etc/UTC' : timezone, }, }; }