diff options
| author | Fuwn <[email protected]> | 2026-04-28 05:23:34 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-04-28 05:23:34 -0700 |
| commit | 6d3d13642569b9d1cf49ab088a6e259b1fe80598 (patch) | |
| tree | 28ad2f1f4a87d1ee787fd8298b760a08d5a14c13 /src/lib | |
| parent | feat(command-palette): add quick toggles, sync, and auth actions (diff) | |
| download | due.moe-6d3d13642569b9d1cf49ab088a6e259b1fe80598.tar.xz due.moe-6d3d13642569b9d1cf49ab088a6e259b1fe80598.zip | |
fix(airing): round residual hour in days countdown
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/Media/Anime/Airing/time.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Media/Anime/Airing/time.ts b/src/lib/Media/Anime/Airing/time.ts index dadcd6f1..8211d30e 100644 --- a/src/lib/Media/Anime/Airing/time.ts +++ b/src/lib/Media/Anime/Airing/time.ts @@ -59,8 +59,13 @@ export const airingTime = ( weeks === 1 || shortenCountdown ? "" : "s" }`; } else { - const days = Math.round(Math.floor(hours / 24)); - const residualHours = Math.floor(hours - days * 24); + let days = Math.floor(hours / 24); + let residualHours = Math.round(hours - days * 24); + + if (residualHours === 24) { + days += 1; + residualHours = 0; + } timeFrame += `${days.toFixed(0)}${shortenCountdown ? "d" : " day"}${ days === 1 || shortenCountdown ? "" : "s" |