aboutsummaryrefslogtreecommitdiff
path: root/src/lib/List/Due/AnimeList.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/List/Due/AnimeList.svelte')
-rw-r--r--src/lib/List/Due/AnimeList.svelte32
1 files changed, 1 insertions, 31 deletions
diff --git a/src/lib/List/Due/AnimeList.svelte b/src/lib/List/Due/AnimeList.svelte
index e65ac965..74c48fef 100644
--- a/src/lib/List/Due/AnimeList.svelte
+++ b/src/lib/List/Due/AnimeList.svelte
@@ -7,6 +7,7 @@
import anime from '../../../stores/anime';
import settings from '../../../stores/settings';
import lastPruneTimes from '../../../stores/lastPruneTimes';
+ import { airingTime } from '$lib/anime';
export let user: AniListAuthorisation;
export let identity: UserIdentity;
@@ -104,37 +105,6 @@
return finalMedia;
};
- const airingTime = (anime: Media) => {
- const untilAiring = anime.nextAiringEpisode?.timeUntilAiring;
- let timeFrame;
-
- if (untilAiring !== undefined) {
- let hours = untilAiring / 3600;
-
- if (hours >= 24) {
- let weeks = Math.floor(Math.floor(hours / 24) / 7);
-
- if (weeks >= 1) {
- weeks = Math.round(weeks);
-
- timeFrame = `${weeks} week${weeks === 1 ? '' : 's'}`;
- } else {
- const days = Math.round(Math.floor(hours / 24));
-
- timeFrame = `${days} day${days === 1 ? '' : 's'}`;
- }
- } else {
- hours = Math.round(hours);
-
- timeFrame = `${hours} hour${hours === 1 ? '' : 's'}`;
- }
-
- return `<span style="opacity: 50%">${anime.nextAiringEpisode?.episode} in ${timeFrame}</span>`;
- }
-
- return '';
- };
-
const totalEpisodes = (anime: Media) => {
return anime.episodes === null ? '' : `<span style="opacity: 50%">/${anime.episodes}</span>`;
};