Skip to content

Commit

Permalink
chore: more lint fixes for use-formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
Ádám Kleizer committed Nov 20, 2024
1 parent 73ef333 commit 1de13d2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frontend/composables/use-formatters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useI18n } from "vue-i18n";
import { format, formatDistance } from "date-fns";
/*eslint import/namespace: ['error', { allowComputed: true }]*/
/* eslint import/namespace: ['error', { allowComputed: true }] */
import * as Locales from "date-fns/locale";

const cache = {
Expand Down Expand Up @@ -33,9 +33,7 @@ function getLocale() {
const localeCode = (t?.locale?.value as string) ?? "en-US";
const lang = localeCode.length > 1 ? localeCode.substring(0, 2) : localeCode;
const region = localeCode.length > 2 ? localeCode.substring(3) : "";
return (
Locales[(lang + region) as keyof typeof Locales] ?? Locales[lang as keyof typeof Locales] ?? Locales.enUS
);
return Locales[(lang + region) as keyof typeof Locales] ?? Locales[lang as keyof typeof Locales] ?? Locales.enUS;
}

export function useLocaleTimeAgo(date: Date) {
Expand Down

0 comments on commit 1de13d2

Please sign in to comment.