thaidatepicker-react
Version:
Thaidatepicker-react is a component for ReactJS that likes other DatePicker, but all we need is Buddhist Year (25XX - aka Thai Year) come with the right render day (example: Sat, 29 Feb 2020 must be equal to Sat, 29 Feb 2563) so I wish this component will
36 lines (35 loc) • 1.35 kB
TypeScript
import "dayjs/locale/th";
import React from "react";
import DatePicker from "react-datepicker";
export interface HighlightDate {
[className: string]: Date[];
}
export interface ThaiDatePickerProps {
children?: React.ReactNode | null;
clearable?: boolean;
customInput?: React.ElementType<any> | null;
disabled?: boolean;
header?: {
prevButtonIcon?: React.ReactNode;
nextButtonIcon?: React.ReactNode;
prevButtonClassName?: string;
nextButtonClassName?: string;
monthSelectClassName?: string;
yearSelectClassName?: string;
} | null;
highlightDates?: (Date | HighlightDate)[];
id?: string;
inputProps?: (any & {
displayFormat?: string;
}) | null;
maxDate?: Date | string;
minDate?: Date | string;
noIntegratedStyle?: boolean;
onChange?: (christDate: string, thaiDate: string) => void;
placeholder?: string;
reactDatePickerProps?: React.ComponentProps<typeof DatePicker>;
readOnly?: boolean;
value?: string;
yearBoundary?: number;
}
export declare const ThaiDatePicker: ({ children, clearable, customInput, disabled, header, highlightDates, id, inputProps, maxDate, minDate, noIntegratedStyle, onChange, placeholder, reactDatePickerProps, readOnly, value, yearBoundary, }: ThaiDatePickerProps) => React.JSX.Element;