Files
Desktop/ts/util/formatDuration.std.ts
Fedor Indutny 44076ece79 Rename files
2025-10-16 23:45:44 -07:00

17 lines
341 B
TypeScript

// Copyright 2019 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import moment from 'moment';
const HOUR = 1000 * 60 * 60;
export function formatDuration(seconds: number): string {
const time = moment.utc(seconds * 1000);
if (seconds > HOUR) {
return time.format('H:mm:ss');
}
return time.format('m:ss');
}