From e2f8cddd22844d7e8d591bc3a27c06d5c2f5ce36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Eikeland?= Date: Mon, 8 Apr 2024 09:50:15 +0200 Subject: [PATCH] fix(date): update Locale interface according to date-fns@3.x.x --- packages/date/src/daterange/element.ts | 2 +- packages/date/src/utils/resolve-locale.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/date/src/daterange/element.ts b/packages/date/src/daterange/element.ts index dc2cc0529..c88fad67d 100644 --- a/packages/date/src/daterange/element.ts +++ b/packages/date/src/daterange/element.ts @@ -2,7 +2,7 @@ import { html, LitElement, PropertyValues, TemplateResult } from 'lit'; import { property } from 'lit/decorators.js'; import { ifDefined } from 'lit/directives/if-defined.js'; import { formatDistance, formatRelative } from 'date-fns'; -import { enGB } from 'date-fns/locale'; +import { enGB, type Locale } from 'date-fns/locale'; import { DateRangeVariant, DateTimeFormat, WeekDay } from '../types'; import { dateConverter, resolveLocale } from '../utils'; diff --git a/packages/date/src/utils/resolve-locale.ts b/packages/date/src/utils/resolve-locale.ts index b74def7f6..c1a740685 100644 --- a/packages/date/src/utils/resolve-locale.ts +++ b/packages/date/src/utils/resolve-locale.ts @@ -1,4 +1,5 @@ import * as locales from 'date-fns/locale'; +import type { Locale } from 'date-fns/locale'; export const resolveLocale = (localeName: string): Locale => { return locales[localeName as keyof typeof locales];