diff options
| author | Fuwn <[email protected]> | 2023-09-17 21:03:57 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-17 21:03:57 -0700 |
| commit | 1387b371a486fe048888396a294e7ce61ff02902 (patch) | |
| tree | 00a05b4b8befc6285ebe519975236eae1f1bfd25 /src | |
| parent | feat(notifications): link to thread for threads (diff) | |
| download | due.moe-1387b371a486fe048888396a294e7ce61ff02902.tar.xz due.moe-1387b371a486fe048888396a294e7ce61ff02902.zip | |
feat(anime): bold if releasing soon
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/Media/anime.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/Media/anime.ts b/src/lib/Media/anime.ts index 0eed9121..19fa693a 100644 --- a/src/lib/Media/anime.ts +++ b/src/lib/Media/anime.ts @@ -29,6 +29,7 @@ export const airingTime = (anime: Media, upcoming = false) => { if (untilAiring !== undefined) { let minutes = untilAiring / 60; + let few = true; if (minutes >= 30) { let hours = minutes / 60; @@ -36,6 +37,8 @@ export const airingTime = (anime: Media, upcoming = false) => { if (hours >= 24) { let weeks = Math.floor(Math.floor(hours / 24) / 7); + few = false; + if (weeks >= 1) { weeks = Math.round(weeks); @@ -59,7 +62,9 @@ export const airingTime = (anime: Media, upcoming = false) => { if (upcoming) { return `${anime.nextAiringEpisode?.episode}${totalEpisodes(anime)} in ${timeFrame}`; } else { - return `<span style="opacity: 50%">${anime.nextAiringEpisode?.episode} in ${timeFrame}</span>`; + return `<span style="opacity: 50%">${anime.nextAiringEpisode?.episode} in ${ + few ? '<b>' : '' + }${timeFrame}${few ? '</b>' : ''}</span>`; } } |