aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Media/Anime
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Media/Anime')
-rw-r--r--src/lib/Media/Anime/Airing/time.ts14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/Media/Anime/Airing/time.ts b/src/lib/Media/Anime/Airing/time.ts
index 4e65843d..6ddc9aff 100644
--- a/src/lib/Media/Anime/Airing/time.ts
+++ b/src/lib/Media/Anime/Airing/time.ts
@@ -21,6 +21,7 @@ export const airingTime = (
});
let timeFrame;
let hours = null;
+ const shortenCountdown = get(settings).displayShortCountdown;
if (
(anime as unknown as MediaPrequel).startDate &&
@@ -55,13 +56,20 @@ export const airingTime = (
// } else {
const days = Math.round(Math.floor(hours / 24));
- timeFrame = `${days.toFixed(0)} day${days === 1 ? '' : 's'}`;
+ timeFrame = `${days.toFixed(0)}${shortenCountdown ? 'd' : ' day'}${
+ days === 1 || shortenCountdown ? '' : 's'
+ }`;
// }
- } else timeFrame = `${hours.toFixed(1)} hour${hours === 1 ? '' : 's'}`;
+ } else
+ timeFrame = `${hours.toFixed(1)}${shortenCountdown ? 'h' : ' hour'}${
+ hours === 1 || shortenCountdown ? '' : 's'
+ }`;
} else {
minutes = Math.round(minutes);
- timeFrame = `${minutes} minute${minutes === 1 ? '' : 's'}`;
+ timeFrame = `${minutes}${shortenCountdown ? 'h' : ' minute'}${
+ minutes === 1 || shortenCountdown ? '' : 's'
+ }`;
}
const opacity = Math.max(50, 100 - (untilAiring / 60 / 60 / 24 / 7) * 50);