From 97b6cc0be907b207c8af9da16878032696564b4d Mon Sep 17 00:00:00 2001 From: Can Bulut Bayburt Date: Tue, 28 May 2024 21:06:29 +0200 Subject: [PATCH 1/2] Fix displayed time in datetime pickers that use server's timezone (bsc#1225196) --- web/html/src/components/datetime/DateTimePicker.tsx | 4 ++-- web/spacewalk-web.changes.cbbayburt.bsc1225196 | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 web/spacewalk-web.changes.cbbayburt.bsc1225196 diff --git a/web/html/src/components/datetime/DateTimePicker.tsx b/web/html/src/components/datetime/DateTimePicker.tsx index 4e3d945e697a..174415b5fa91 100644 --- a/web/html/src/components/datetime/DateTimePicker.tsx +++ b/web/html/src/components/datetime/DateTimePicker.tsx @@ -89,8 +89,8 @@ export const DateTimePicker = (props: Props) => { // We use localizedMoment to clone the date so we don't modify the original const browserTimezoneValue = localizedMoment(props.value) - // We convert the date to the users configured timezone because this is what we want to show the user - .tz(localizedMoment.userTimeZone) + // We convert the date to the user's or server's configured timezone because this is what we want to show the user + .tz(timeZone) // The react-datepicker component only shows the browsers local timezone and will convert any date to that // before showing so since we already got the date with the right values we now pretend the date we have is in // the browsers local timezone but without changing its values. This will prevent the react component from diff --git a/web/spacewalk-web.changes.cbbayburt.bsc1225196 b/web/spacewalk-web.changes.cbbayburt.bsc1225196 new file mode 100644 index 000000000000..3dadb99112c9 --- /dev/null +++ b/web/spacewalk-web.changes.cbbayburt.bsc1225196 @@ -0,0 +1,2 @@ +- Fix displayed time in datetime pickers that use server's + timezone (bsc#1225196) From 17847206fd360701ff2ef17d6a9a5b1b5727c15a Mon Sep 17 00:00:00 2001 From: Can Bulut Bayburt Date: Tue, 28 May 2024 21:08:12 +0200 Subject: [PATCH 2/2] Show server's timezone with the execution time in recurring action details --- .../src/manager/recurring/recurring-actions-details.tsx | 7 +++++-- web/spacewalk-web.changes.cbbayburt.bsc1225196 | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/html/src/manager/recurring/recurring-actions-details.tsx b/web/html/src/manager/recurring/recurring-actions-details.tsx index 0f7124685a3d..49cd6b66dbf1 100644 --- a/web/html/src/manager/recurring/recurring-actions-details.tsx +++ b/web/html/src/manager/recurring/recurring-actions-details.tsx @@ -11,6 +11,7 @@ import { TopPanel } from "components/panels/TopPanel"; import { Column } from "components/table/Column"; import { Table } from "components/table/Table"; +import { localizedMoment } from "utils"; import Network from "utils/network"; import { DisplayHighstate } from "../state/display-highstate"; @@ -94,14 +95,16 @@ class RecurringActionsDetails extends React.Component {"Every day at "} - {details.cronTimes.hour + ":" + details.cronTimes.minute} + {`${details.cronTimes.hour}:${details.cronTimes.minute} `} + {localizedMoment.serverTimeZoneAbbr} ) : details.type === "weekly" ? ( {"Every "} {this.weekDays[details.cronTimes.dayOfWeek - 1]} {" at "} - {details.cronTimes.hour + ":" + details.cronTimes.minute} + {`${details.cronTimes.hour}:${details.cronTimes.minute} `} + {localizedMoment.serverTimeZoneAbbr} ) : ( diff --git a/web/spacewalk-web.changes.cbbayburt.bsc1225196 b/web/spacewalk-web.changes.cbbayburt.bsc1225196 index 3dadb99112c9..84536ee0d8ea 100644 --- a/web/spacewalk-web.changes.cbbayburt.bsc1225196 +++ b/web/spacewalk-web.changes.cbbayburt.bsc1225196 @@ -1,2 +1,3 @@ +- Show server timezone with execution time in recurring action details - Fix displayed time in datetime pickers that use server's timezone (bsc#1225196)