zaman
Version:
React component that helps you to makes simple Farsi/Jalali/Shamsi date picker. It also has range date picker you can select multiple days in multiple months.
20 lines (19 loc) • 751 B
TypeScript
import type { DaysRange, DatePickerValue, onRangeDatePickerChangePayload, onDatePickerChangePayload } from '../../types';
export interface CalendarBaseProps {
defaultValue?: Date;
weekends?: DaysRange[];
className?: string;
}
export interface CalendarRangeProps {
range: true;
from?: DatePickerValue;
to?: DatePickerValue;
rangeValue?: Date[];
onChange?: (args: onRangeDatePickerChangePayload) => void;
}
export interface CalendarDefaultProps {
range?: false | undefined;
onChange?: (args: onDatePickerChangePayload) => void;
}
export type OnChangePayload = onRangeDatePickerChangePayload | onDatePickerChangePayload;
export type CalendarProps = CalendarBaseProps & (CalendarRangeProps | CalendarDefaultProps);