mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
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:
13
frontend/src/Utilities/Date/formatRuntime.js
Normal file
13
frontend/src/Utilities/Date/formatRuntime.js
Normal 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;
|
Reference in New Issue
Block a user