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 rendering of mean times #1086

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 2 additions & 4 deletions src/components/systems/partials/MeanQueueTimeCell.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { renderValidDate } from "../../../utils/dateUtils";
import { Service } from "../../../slices/serviceSlice";
import moment from "moment";

/**
* This component renders the mean queue time cells of systems in the table view
Expand All @@ -11,11 +10,10 @@ const MeanQueueTimeCell = ({
}: {
row: Service
}) => {
const { t } = useTranslation();

return (
<span>
{t("dateFormats.time.medium", { time: renderValidDate(row.meanQueueTime.toString()) })}
{ moment.utc(moment.duration(row.meanQueueTime* 1000).asMilliseconds()).format("HH:mm:ss") }
</span>
);
};
Expand Down
6 changes: 2 additions & 4 deletions src/components/systems/partials/MeanRunTimeCell.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import { useTranslation } from "react-i18next";
import { renderValidDate } from "../../../utils/dateUtils";
import { Service } from "../../../slices/serviceSlice";
import moment from "moment";

/**
* This component renders the mean run time cells of systems in the table view
Expand All @@ -11,11 +10,10 @@ const MeanRunTimeCell = ({
}: {
row: Service
}) => {
const { t } = useTranslation();

return (
<span>
{t("dateFormats.time.medium", { time: renderValidDate(row.meanRunTime.toString()) })}
{ moment.utc(moment.duration(row.meanRunTime * 1000).asMilliseconds()).format("HH:mm:ss") }
</span>
);
};
Expand Down
Loading