From 17e26689cd5761f5de94efc519b191d8edca8b8a Mon Sep 17 00:00:00 2001 From: Denis Kopitsa Date: Wed, 12 Nov 2025 21:28:45 +0300 Subject: [PATCH] fix(types): align i18n and date utils with date-fns@4 type exports --- packages/gantt/src/i18n/i18n.ts | 2 +- packages/gantt/src/i18n/locales/de-de.ts | 3 ++- packages/gantt/src/i18n/locales/ru-ru.ts | 3 ++- packages/gantt/src/utils/date.ts | 5 ++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/gantt/src/i18n/i18n.ts b/packages/gantt/src/i18n/i18n.ts index 6db24e52..8b26e134 100644 --- a/packages/gantt/src/i18n/i18n.ts +++ b/packages/gantt/src/i18n/i18n.ts @@ -1,5 +1,5 @@ import { InjectionToken } from '@angular/core'; -import { Locale as DateFnsLocale } from 'date-fns'; +import type { Locale as DateFnsLocale } from 'date-fns'; import { GanttViewType } from '../class'; export enum GanttI18nLocale { diff --git a/packages/gantt/src/i18n/locales/de-de.ts b/packages/gantt/src/i18n/locales/de-de.ts index 3b5294a0..5924aa5b 100644 --- a/packages/gantt/src/i18n/locales/de-de.ts +++ b/packages/gantt/src/i18n/locales/de-de.ts @@ -1,10 +1,11 @@ import { de } from 'date-fns/locale'; +import type { Locale as DateFnsLocale } from 'date-fns'; import { GanttViewType } from '../../class'; import { GanttI18nLocale } from '../i18n'; export default { id: GanttI18nLocale.deDe, - dateLocale: de, + dateLocale: de as DateFnsLocale, views: { [GanttViewType.hour]: { label: 'Stündlich', diff --git a/packages/gantt/src/i18n/locales/ru-ru.ts b/packages/gantt/src/i18n/locales/ru-ru.ts index 0eea054d..ef3a798b 100644 --- a/packages/gantt/src/i18n/locales/ru-ru.ts +++ b/packages/gantt/src/i18n/locales/ru-ru.ts @@ -1,10 +1,11 @@ import { ru } from 'date-fns/locale'; +import type { Locale as DateFnsLocale } from 'date-fns'; import { GanttViewType } from '../../class'; import { GanttI18nLocale } from '../i18n'; export default { id: GanttI18nLocale.ruRu, - dateLocale: ru, + dateLocale: ru as DateFnsLocale, views: { [GanttViewType.hour]: { label: 'Ежечасно', diff --git a/packages/gantt/src/utils/date.ts b/packages/gantt/src/utils/date.ts index b4d908b5..d890cf01 100644 --- a/packages/gantt/src/utils/date.ts +++ b/packages/gantt/src/utils/date.ts @@ -30,10 +30,9 @@ import { startOfHour, endOfHour, endOfMinute, - Locale, - FirstWeekContainsDate + Locale } from 'date-fns'; - +import type { FirstWeekContainsDate } from 'date-fns/types'; import { TZDate } from '@date-fns/tz'; export {