Skip to content

Commit

Permalink
fix(useDatePicker): fix onDateSelect type, export types
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Oct 8, 2024
1 parent 85f0614 commit a8e90f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { useResolvedDirection } from './useResolvedDirection'
export { useDatePicker } from './useDatePicker'
export { useDatePicker, DatePickerOptions, OnDateSelectPayload } from './useDatePicker'
13 changes: 7 additions & 6 deletions src/hooks/useDatePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ import {
import { useResolvedLocaleOptions } from './internal/useResolvedLocaleOptions'
import { useWeekDayLabels } from './internal/useWeekDayLabels'

type DatePickerOptions = {
export type OnDateSelectPayload = {
calendarDate: Temporal.ZonedDateTime
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 a8e90f4

Please sign in to comment.