diff --git a/.changeset/ninety-eagles-admire.md b/.changeset/ninety-eagles-admire.md new file mode 100644 index 000000000..a76bf0440 --- /dev/null +++ b/.changeset/ninety-eagles-admire.md @@ -0,0 +1,5 @@ +--- +"@equinor/fusion-wc-date": patch +--- + +Update date-fns from 2.30.0 to 3.3.1 diff --git a/packages/date/package.json b/packages/date/package.json index 5a49e586f..f96d8051c 100644 --- a/packages/date/package.json +++ b/packages/date/package.json @@ -30,7 +30,7 @@ "dependencies": { "@equinor/fusion-wc-core": "workspace:^", "@equinor/fusion-web-theme": "^0.1.10", - "date-fns": "^2.29.3", + "date-fns": "^3.3.1", "lit": "3.1.2" }, "devDependencies": { 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]; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 191b11261..23aee9084 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -213,8 +213,8 @@ importers: specifier: ^0.1.10 version: 0.1.10 date-fns: - specifier: ^2.29.3 - version: 2.30.0 + specifier: ^3.3.1 + version: 3.3.1 lit: specifier: ^3.0.2 version: 3.0.2 @@ -7279,11 +7279,8 @@ packages: resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==} dev: false - /date-fns@2.30.0: - resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} - engines: {node: '>=0.11'} - dependencies: - '@babel/runtime': 7.22.15 + /date-fns@3.3.1: + resolution: {integrity: sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==} dev: false /debounce@1.2.1: