Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing types of datepicker #16334

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/react/src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { usePrefix } from '../../internal/usePrefix';
import { useSavedCallback } from '../../internal/useSavedCallback';
import { FormContext } from '../FluidForm';
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
import { DateLimit, DateOption } from 'flatpickr/dist/types/options';

// Weekdays shorthand for english locale
l10n.en.weekdays.shorthand.forEach((_day, index) => {
Expand Down Expand Up @@ -243,12 +244,12 @@ interface DatePickerProps {
/**
* The flatpickr `disable` option that allows a user to disable certain dates.
*/
disable?: string[];
disable?: DateLimit<DateOption>[];

/**
* The flatpickr `enable` option that allows a user to enable certain dates.
*/
enable?: string[];
enable?: DateLimit<DateOption>[];

/**
* The flatpickr `inline` option.
Expand Down Expand Up @@ -342,12 +343,12 @@ interface DatePickerProps {
/**
* The maximum date that a user can pick to.
*/
maxDate?: string | number;
maxDate?: DateOption;

/**
* The minimum date that a user can start picking from.
*/
minDate?: string | number;
minDate?: DateOption;

/**
* The `change` event handler.
Expand Down
Loading