Skip to content

Commit 6e281a6

Browse files
committed
Merge branch 'render-mean-times-as-duration' of Arnei/opencast-admin-interface into main
Pull request #1086 Fixes #923 Fix rendering of mean times
2 parents 036298f + d0d38ab commit 6e281a6

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/components/systems/partials/MeanQueueTimeCell.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
2-
import { useTranslation } from "react-i18next";
3-
import { renderValidDate } from "../../../utils/dateUtils";
42
import { Service } from "../../../slices/serviceSlice";
3+
import moment from "moment";
54

65
/**
76
* This component renders the mean queue time cells of systems in the table view
@@ -11,11 +10,10 @@ const MeanQueueTimeCell = ({
1110
}: {
1211
row: Service
1312
}) => {
14-
const { t } = useTranslation();
1513

1614
return (
1715
<span>
18-
{t("dateFormats.time.medium", { time: renderValidDate(row.meanQueueTime.toString()) })}
16+
{ moment.utc(moment.duration(row.meanQueueTime* 1000).asMilliseconds()).format("HH:mm:ss") }
1917
</span>
2018
);
2119
};

src/components/systems/partials/MeanRunTimeCell.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from "react";
2-
import { useTranslation } from "react-i18next";
3-
import { renderValidDate } from "../../../utils/dateUtils";
42
import { Service } from "../../../slices/serviceSlice";
3+
import moment from "moment";
54

65
/**
76
* This component renders the mean run time cells of systems in the table view
@@ -11,11 +10,10 @@ const MeanRunTimeCell = ({
1110
}: {
1211
row: Service
1312
}) => {
14-
const { t } = useTranslation();
1513

1614
return (
1715
<span>
18-
{t("dateFormats.time.medium", { time: renderValidDate(row.meanRunTime.toString()) })}
16+
{ moment.utc(moment.duration(row.meanRunTime * 1000).asMilliseconds()).format("HH:mm:ss") }
1917
</span>
2018
);
2119
};

0 commit comments

Comments
 (0)