Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3c6612d

Browse files
committed
Fix hyper-precise presence
Signed-off-by: Šimon Brandner <[email protected]>
1 parent 8f6d31b commit 3c6612d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/views/rooms/PresenceLabel.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ export default class PresenceLabel extends React.Component<IProps> {
4141
// XXX: This would be better handled using a culture-aware library, but we don't use one yet.
4242
private getDuration(time: number): string {
4343
if (!time) return;
44-
const t = time / 1000;
44+
const t = Math.round(time / 1000);
4545
const s = t % 60;
46-
const m = t / 60 % 60;
47-
const h = t / (60 * 60) % 24;
48-
const d = t / (60 * 60 * 24);
46+
const m = Math.round(t / 60) % 60;
47+
const h = Math.round(t / (60 * 60)) % 24;
48+
const d = Math.round(t / (60 * 60 * 24));
4949
if (t < 60) {
5050
if (t < 0) {
5151
return _t("%(duration)ss", { duration: 0 });

0 commit comments

Comments
 (0)