trending: format video duration
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
42c56c6792
commit
6de055dc50
@ -0,0 +1,9 @@
|
||||
import { Duration } from "luxon";
|
||||
|
||||
const formatDuration = (ms: number): string => {
|
||||
if (ms / (60 * 60 * 1000) >= 1)
|
||||
return Duration.fromMillis(ms).toFormat("HH:mm:ss");
|
||||
else return Duration.fromMillis(ms).toFormat("mm:ss");
|
||||
};
|
||||
|
||||
export default formatDuration;
|
Loading…
Reference in new issue