Show day counts in call durations (#9641)
* Show day counts in call durations Previously call durations over a day long would be truncated, for example displaying as '2h 0m 0s' instead of '1d 2h 0m 0s'. * Fix strict mode errors * Fix strings Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
parent
440f76c3e8
commit
69e03860a0
6 changed files with 55 additions and 25 deletions
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
import React, { FC, useState, useEffect, memo } from "react";
|
||||
import { GroupCall } from "matrix-js-sdk/src/webrtc/groupCall";
|
||||
|
||||
import { formatCallTime } from "../../../DateUtils";
|
||||
import { formatPreciseDuration } from "../../../DateUtils";
|
||||
|
||||
interface CallDurationProps {
|
||||
delta: number;
|
||||
|
@ -29,7 +29,7 @@ interface CallDurationProps {
|
|||
export const CallDuration: FC<CallDurationProps> = memo(({ delta }) => {
|
||||
// Clock desync could lead to a negative duration, so just hide it if that happens
|
||||
if (delta <= 0) return null;
|
||||
return <div className="mx_CallDuration">{ formatCallTime(new Date(delta)) }</div>;
|
||||
return <div className="mx_CallDuration">{ formatPreciseDuration(delta) }</div>;
|
||||
});
|
||||
|
||||
interface GroupCallDurationProps {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue