aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/Media/Anime/Airing/time.ts14
-rw-r--r--src/lib/Settings/Categories/Display.svelte4
-rw-r--r--src/stores/settings.ts2
3 files changed, 17 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);
diff --git a/src/lib/Settings/Categories/Display.svelte b/src/lib/Settings/Categories/Display.svelte
index 4b38bef1..69b26aec 100644
--- a/src/lib/Settings/Categories/Display.svelte
+++ b/src/lib/Settings/Categories/Display.svelte
@@ -88,6 +88,10 @@
setting="displayNativeCountdown"
text="Use native release date for episode countdown"
/>
+<SettingCheckboxToggle
+ setting="displayShortCountdown"
+ text="Shorten countdown to first character of unit"
+/>
<p />
diff --git a/src/stores/settings.ts b/src/stores/settings.ts
index b49429d5..b7eddcd1 100644
--- a/src/stores/settings.ts
+++ b/src/stores/settings.ts
@@ -34,6 +34,7 @@ export interface Settings {
displayDisableNotifications: boolean;
displayCoverMode: boolean;
displayCoverWidth: number;
+ displayShortCountdown: boolean;
}
const defaultSettings: Settings = {
@@ -64,6 +65,7 @@ const defaultSettings: Settings = {
displayDisableNotifications: false,
displayCoverMode: false,
displayCoverWidth: 116.609,
+ displayShortCountdown: false,
// Calculation
calculateChaptersRoundedDown: true,