Skip to content

Commit

Permalink
fix(useDatePicker): fix onDateSelect type, export types (#79)
Browse files Browse the repository at this point in the history
* fix(useDatePicker): fix onDateSelect type, export types

* fix: remove calendarDate from OnDateSelectPayload

* style: run prettier
  • Loading branch information
Birkbjo authored Oct 9, 2024
1 parent a552534 commit 94358d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
export { useResolvedDirection } from './useResolvedDirection'
export { useDatePicker } from './useDatePicker'
export {
useDatePicker,
DatePickerOptions,
OnDateSelectPayload,
} from './useDatePicker'
12 changes: 6 additions & 6 deletions src/hooks/useDatePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import {
import { useResolvedLocaleOptions } from './internal/useResolvedLocaleOptions'
import { useWeekDayLabels } from './internal/useWeekDayLabels'

type DatePickerOptions = {
export type OnDateSelectPayload = {
calendarDateString: string
} | null

export type DatePickerOptions = {
date: string
options: PickerOptions
onDateSelect: ({
calendarDateString,
}: {
calendarDateString: string
}) => void
onDateSelect: (payload: OnDateSelectPayload) => void
minDate?: string
maxDate?: string
format?: 'YYYY-MM-DD' | 'DD-MM-YYYY'
Expand Down

0 comments on commit 94358d2

Please sign in to comment.