diff --git a/src/fireedge/src/client/components/Forms/Vm/CreateSchedActionForm/fields.js b/src/fireedge/src/client/components/Forms/Vm/CreateSchedActionForm/fields.js index ec55beba77..59a8183b60 100644 --- a/src/fireedge/src/client/components/Forms/Vm/CreateSchedActionForm/fields.js +++ b/src/fireedge/src/client/components/Forms/Vm/CreateSchedActionForm/fields.js @@ -23,6 +23,7 @@ import { PERIOD_TYPES, REPEAT_VALUES, SCHEDULE_TYPE, + SERVER_CONFIG, T, TEMPLATE_SCHEDULE_TYPE_STRING, VM_ACTIONS_IN_CHARTER, @@ -67,13 +68,13 @@ const DAYS_OF_WEEK = [ T.Saturday, ] -const getNow = () => DateTime.now() +const getNow = () => + SERVER_CONFIG?.currentTimeZone + ? DateTime.now().setZone(SERVER_CONFIG.currentTimeZone) + : DateTime.now() const getTomorrow = () => getNow().plus({ days: 1 }) -const getTomorrowAtMidnight = () => - getTomorrow().set({ hour: 12, minute: 0, second: 0 }) - const getNextWeek = () => getNow().plus({ weeks: 1 }) const parseDateString = (_, originalValue) => { @@ -239,7 +240,7 @@ const TIME_FIELD = { typeAction !== SCHEDULE_TYPE.RELATIVE ? schema.required() : schema ), fieldProps: { - defaultValue: getTomorrowAtMidnight(), + defaultValue: getTomorrow(), minDateTime: getNow(), }, } diff --git a/src/fireedge/src/server/routes/entrypoints/App.js b/src/fireedge/src/server/routes/entrypoints/App.js index d2a08883eb..ed749581bf 100644 --- a/src/fireedge/src/server/routes/entrypoints/App.js +++ b/src/fireedge/src/server/routes/entrypoints/App.js @@ -49,13 +49,21 @@ const ensuredScriptValue = (value) => const router = Router() +const defaultConfig = { + currentTimeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, +} + router.get('*', async (req, res) => { const remoteJWT = {} const APP_CONFIG = { - [defaultApps.provision.name]: getProvisionConfig() || {}, + [defaultApps.provision.name]: + { ...defaultConfig, ...getProvisionConfig() } || defaultConfig, [defaultApps.sunstone.name]: - getSunstoneConfig({ includeProtectedConfig: false }) || {}, + { + ...defaultConfig, + ...getSunstoneConfig({ includeProtectedConfig: false }), + } || defaultConfig, } const appConfig = getFireedgeConfig()