From 389c888dfb41522ead62508cf174650b11a21cfa Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Wed, 7 Feb 2024 08:21:33 -0800
Subject: feat(locale): localise airing time

---
 src/lib/Media/Anime/Airing/AiringTime.svelte | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

(limited to 'src/lib/Media/Anime/Airing/AiringTime.svelte')

diff --git a/src/lib/Media/Anime/Airing/AiringTime.svelte b/src/lib/Media/Anime/Airing/AiringTime.svelte
index 5a17a1e7..9a9a1726 100644
--- a/src/lib/Media/Anime/Airing/AiringTime.svelte
+++ b/src/lib/Media/Anime/Airing/AiringTime.svelte
@@ -6,6 +6,7 @@
 	import type { MediaPrequel } from '$lib/AniList/prequels';
 	import { injectAiringTime } from './Subtitled/match';
 	import tooltip from '$lib/Tooltip/tooltip';
+	import locale from '$stores/locale';
 
 	export let originalAnime: Media;
 	export let subsPlease: SubsPlease | null;
@@ -106,15 +107,7 @@
 				}
 
 				opacity = Math.max(50, 100 - (untilAiring / 60 / 60 / 24 / 7) * 50);
-				dateString =
-					new Date(airingAt ? airingAt * 1000 : 0).toLocaleDateString([], {
-						weekday: 'long',
-						year: 'numeric',
-						month: 'long',
-						day: 'numeric'
-					}) +
-					' ' +
-					time;
+				dateString = $locale().dateFormatter(new Date(airingAt ? airingAt * 1000 : 0));
 			}
 		};
 
-- 
cgit v1.2.3

