New: Update time column on Movie > Index > Table to show hour minutes instead of only minutespull/4916/head
parent
df197d2e16
commit
a28c5675ef
@ -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;
|
Loading…
Reference in new issue