react-native-flexi-datepicker
Version:
A highly customizable and flexible date picker component for React Native
53 lines (52 loc) • 1.4 kB
TypeScript
import React from "react";
import { ViewStyle, TextStyle } from "react-native";
import { Moment } from "moment";
import { PickerStyle } from "../utils/types";
interface LocaleData {
abbr: string;
calendar: {
monthNames: string[];
monthNamesShort: string[];
dayNames: string[];
dayNamesShort: string[];
};
}
interface ThemeColors {
primary: string;
background: string;
text: string;
selectedText: string;
disabledText: string;
headerBackground: string;
yearText: string;
monthYearText: string;
buttonText: string;
todayText: string;
dayText: string;
dotColor: string;
selectedDotColor: string;
arrowColor: string;
monthTextColor: string;
indicatorColor: string;
}
interface DatePickerProps {
isVisible: boolean;
onClose: () => void;
onDateChange: (date: string) => void;
initialDate?: string | Date | Moment;
minDate?: string | Date | Moment;
maxDate?: string | Date | Moment;
localeData?: LocaleData;
cancelButton?: string;
okButton?: string;
animationEnabled?: boolean;
theme?: Partial<ThemeColors>;
headerFormat?: string;
monthYearFormat?: string;
customStyles?: {
[key: string]: ViewStyle | TextStyle;
};
pickerStyle: PickerStyle;
}
declare const DatePicker: React.FC<DatePickerProps>;
export default DatePicker;