From 9eeef869a6c900f3aa39339f6cdd74591689d320 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 13 Dec 2023 04:42:21 -0800 Subject: feat(anime): 24-hour time format --- src/lib/Media/anime.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lib/Media') diff --git a/src/lib/Media/anime.ts b/src/lib/Media/anime.ts index 354321db..937e9dac 100644 --- a/src/lib/Media/anime.ts +++ b/src/lib/Media/anime.ts @@ -3,6 +3,7 @@ import anime from '../../stores/anime'; import { mediaListCollection, type Media, Type } from '../AniList/media'; import lastPruneTimes from '../../stores/lastPruneTimes'; import type { AniListAuthorisation, UserIdentity } from '../AniList/identity'; +import settings from '../../stores/settings'; export const cleanCache = (user: AniListAuthorisation, identity: UserIdentity) => mediaListCollection(user, identity, Type.Anime, get(anime), get(lastPruneTimes).anime, true); @@ -19,6 +20,7 @@ export const airingTime = (anime: Media, upcoming = false) => { const untilAiring = airingAt ? Math.round((airingAt - Date.now() / 1000) * 100) / 100 : undefined; let timeFrame; const time = new Date(airingAt ? airingAt * 1000 : 0).toLocaleTimeString([], { + hour12: !settings.get().display24HourTime, hour: 'numeric', minute: '2-digit' }); -- cgit v1.2.3