mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-26 22:56:23 -04:00
f22998aef3
Closes #3482
22 lines
340 B
TypeScript
22 lines
340 B
TypeScript
function formatRuntime(runtime: number) {
|
|
if (!runtime) {
|
|
return '';
|
|
}
|
|
|
|
const hours = Math.floor(runtime / 60);
|
|
const minutes = runtime % 60;
|
|
const result = [];
|
|
|
|
if (hours) {
|
|
result.push(`${hours}h`);
|
|
}
|
|
|
|
if (minutes) {
|
|
result.push(`${minutes}m`);
|
|
}
|
|
|
|
return result.join(' ');
|
|
}
|
|
|
|
export default formatRuntime;
|