From 5bccb5c40aed22f82991741960b6a4206b01fc93 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Fri, 16 Aug 2024 16:50:18 +0200 Subject: [PATCH] fuck the linter --- frontend/src/composables/useTime.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/composables/useTime.ts b/frontend/src/composables/useTime.ts index 6f9cf27c4..1f80ad950 100644 --- a/frontend/src/composables/useTime.ts +++ b/frontend/src/composables/useTime.ts @@ -1,7 +1,8 @@ import type { Composer } from "vue-i18n"; export function lastUpdated(date: Date | string, i18n?: Composer): string { - i18n = i18n ?? useI18n(); + // some dum linter hates me + const lang = (i18n ?? useI18n())!; date = new Date(date); const today: Date = new Date(); const todayTime = today.getTime(); @@ -9,12 +10,12 @@ export function lastUpdated(date: Date | string, i18n?: Composer): string { const todayDays = Math.floor(todayTime / (1000 * 60 * 60 * 24)); const dateDays = Math.floor(dateTime / (1000 * 60 * 60 * 24)); if (todayDays === dateDays) { - return i18n.t("general.today") + " " + i18n.d(date, "clock"); + return lang.t("general.today") + " " + lang.d(date, "clock"); } else if (todayDays === dateDays + 1) { - return i18n.t("general.yesterday") + " " + i18n.d(date, "clock"); + return lang.t("general.yesterday") + " " + lang.d(date, "clock"); } else if (todayDays - dateDays < 7) { - return i18n.d(date, "shortweektime"); + return lang.d(date, "shortweektime"); } else { - return i18n.d(date, "date"); + return lang.d(date, "date"); } }