Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timezone issues with recurring action datetime pickers (bsc#1225196) #8833

Merged
merged 2 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/html/src/components/datetime/DateTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -94,14 +95,16 @@ class RecurringActionsDetails extends React.Component<RecurringActionsDetailsPro
) : details.type === "daily" ? (
<td>
{"Every day at "}
<b>{details.cronTimes.hour + ":" + details.cronTimes.minute}</b>
<b>{`${details.cronTimes.hour}:${details.cronTimes.minute} `}</b>
{localizedMoment.serverTimeZoneAbbr}
</td>
) : details.type === "weekly" ? (
<td>
{"Every "}
<b>{this.weekDays[details.cronTimes.dayOfWeek - 1]}</b>
{" at "}
<b>{details.cronTimes.hour + ":" + details.cronTimes.minute}</b>
<b>{`${details.cronTimes.hour}:${details.cronTimes.minute} `}</b>
{localizedMoment.serverTimeZoneAbbr}
</td>
) : (
<td>
Expand Down
3 changes: 3 additions & 0 deletions web/spacewalk-web.changes.cbbayburt.bsc1225196
Original file line number Diff line number Diff line change
@@ -0,0 +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)
Loading