diff --git a/src/components/Detail/InfoView.astro b/src/components/Detail/InfoView.astro index 4bde49e..5da41b8 100644 --- a/src/components/Detail/InfoView.astro +++ b/src/components/Detail/InfoView.astro @@ -15,8 +15,19 @@ function formatTime(seconds) { return result; } -const workTime = formatTime(re.worktime) -const waitTime = formatTime(re.waittime) +function formatTimeMin(minutes) { + if (minutes === 0) return null + const h = Math.floor(minutes / 60); + const m = minutes % 60; + let result = ""; + if (h > 0) result += `${h}h`; + if (m > 0) result += `${m}m`; + if (result === "") result = "0m"; + return result; +} + +const workTime = formatTimeMin(re.worktime) +const waitTime = formatTimeMin(re.waittime) ---

{re.description}