Skip to content

Commit 9e3b93d

Browse files
Fix days selector to ignore daylight savings (#3117)
1 parent d77cf93 commit 9e3b93d

File tree

1 file changed

+5
-2
lines changed
  • portal-ui/src/screens/Console/Common/FormComponents/DaysSelector

1 file changed

+5
-2
lines changed

portal-ui/src/screens/Console/Common/FormComponents/DaysSelector/DaysSelector.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ const calculateNewTime = (
3333
hours: number,
3434
minutes: number,
3535
) => {
36-
return DateTime.fromJSDate(initialDate).plus({ days, hours, minutes });
36+
return DateTime.fromJSDate(initialDate).plus({
37+
hours: hours + days * 24,
38+
minutes,
39+
}); // Lump days into hours to avoid daylight savings causing issues
3740
};
3841

3942
const DaysSelector = ({
@@ -249,7 +252,7 @@ const DaysSelector = ({
249252
<LinkIcon />
250253
<div>{entity} will be available until:</div>{" "}
251254
<div className={"validTill"}>
252-
{dateSelected.toFormat("MM/dd/yyyy HH:mm:ss")}
255+
{dateSelected.toFormat("MM/dd/yyyy HH:mm:ss ZZZZ")}
253256
</div>
254257
</div>
255258
) : (

0 commit comments

Comments
 (0)