Fix: Address issue when runtime is under 1 hour and it falls back to 12h.

New: Update time column on Movie > Index > Table to show hour minutes instead of only minutes
This commit is contained in:
nitsua
2020-08-24 21:22:38 -04:00
committed by Qstick
parent df197d2e16
commit a28c5675ef
3 changed files with 17 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
function formatRuntime(minutes) {
if (!minutes) {
return '0m';
}
const movieHours = Math.floor(minutes / 60);
const movieMinutes = (minutes <= 59) ? minutes : minutes % 60;
const formattedRuntime = `${((movieHours > 0) ? `${movieHours}h ` : '') + movieMinutes}m`;
return formattedRuntime;
}
export default formatRuntime;