mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-27 23:06:29 -04:00
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user