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

Fix hyper-precise presence #6270

Merged
merged 1 commit into from
Jun 26, 2021
Merged
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
8 changes: 4 additions & 4 deletions src/components/views/rooms/PresenceLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export default class PresenceLabel extends React.Component<IProps> {
// XXX: This would be better handled using a culture-aware library, but we don't use one yet.
private getDuration(time: number): string {
if (!time) return;
const t = time / 1000;
const t = Math.round(time / 1000);
const s = t % 60;
const m = t / 60 % 60;
const h = t / (60 * 60) % 24;
const d = t / (60 * 60 * 24);
const m = Math.round(t / 60) % 60;
const h = Math.round(t / (60 * 60)) % 24;
const d = Math.round(t / (60 * 60 * 24));
if (t < 60) {
if (t < 0) {
return _t("%(duration)ss", { duration: 0 });
Expand Down