Skip to content

Commit

Permalink
fix: add Locale type imports
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartSquared committed Jan 16, 2024
1 parent 47448b1 commit 1b584da
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react"
import type { Locale } from "date-fns"
import {
DayPicker,
DateRange,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { format } from "date-fns"
import { Locale, format } from "date-fns"
import { DateFormat } from "../enums"
import { isInvalidDate } from "./isInvalidDate"

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/Calendar/utils/formatDateAsText.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { format } from "date-fns"
import { Locale, format } from "date-fns"
import { DateFormat } from "../enums"
import { DisabledDays } from "../types"
import { isDisabledDate } from "./isDisabledDate"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Locale } from "date-fns"
import { parseDateFromNumeralFormatValue } from "./parseDateFromNumeralFormatValue"
import { parseDateFromTextFormatValue } from "./parseDateFromTextFormatValue"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from "date-fns"
import { Locale, parse } from "date-fns"
import { DateFormat } from "../enums"

export const parseDateFromNumeralFormatValue = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse } from "date-fns"
import { Locale, parse } from "date-fns"
import { DateFormat } from "../enums"

export const parseDateFromTextFormatValue = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react"
import { useIntl } from "@cultureamp/i18n-react-intl"
import type { Locale } from "date-fns"
import { LabelledMessage } from "~components/LabelledMessage"
import { formatDescriptionInputFormat } from "./utils/formatDescriptionInputFormat"
import styles from "./DateInputDescription.module.scss"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import type { Locale } from "date-fns"

export const formatDescriptionInputFormat = (locale: Locale): string =>
locale.formatLong?.date({ width: "short" }).toLowerCase()
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useId } from "react"
import classnames from "classnames"
import type { Locale } from "date-fns"
import { enAU } from "date-fns/locale"
import {
DateInputDescription,
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/DatePicker/utils/getLocale.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Locale } from "date-fns"
import { enAU, enUS } from "date-fns/locale"
import { StringSuggestions } from "~types/StringSuggestions"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Locale } from "date-fns"
import {
DisabledDays,
formatDateAsNumeral,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react"
import type { Locale } from "date-fns"
import {
DateInput,
DateInputProps,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Locale } from "date-fns"
import { DisabledDays, formatDateAsText } from "~components/Calendar"

export const transformDateToInputValue = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react"
import type { Locale } from "date-fns"
import { formatDateAsText } from "~components/Calendar"
import styles from "./DateRangeDisplayLabel.module.scss"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { HTMLAttributes } from "react"
import classnames from "classnames"
import type { Locale } from "date-fns"
import {
DateInput,
DateInputDescription,
Expand Down

0 comments on commit 1b584da

Please sign in to comment.