mantine-datetime-picker
Version:
Mantine UI Datetime Picker component.
39 lines (38 loc) • 1.83 kB
TypeScript
import React from "react";
import { DatePickerBaseSharedProps } from "@mantine/dates";
import { CalendarSharedProps } from "@mantine/dates/lib/components/CalendarBase/CalendarBase";
import { FirstDayOfWeek } from "@mantine/dates/lib/types";
export interface DateTimePickerProps extends Omit<DatePickerBaseSharedProps, "onChange">, Omit<CalendarSharedProps, "size" | "classNames" | "styles" | "onMonthChange" | "onChange" | "isDateInRange" | "isDateFirstInRange" | "isDateLastInRange" | "month"> {
/** Selected date, required with controlled input */
value?: Date | null;
/** Called when date changes */
onChange?(value: Date | null): void;
/** Default value for uncontrolled input */
defaultValue?: Date | null;
/** Set to true to open dropdown on clear */
openDropdownOnClear?: boolean;
/** dayjs input format */
inputFormat?: string;
/** Control initial dropdown opened state */
initiallyOpened?: boolean;
/** Parser function for date provided by input typing */
dateParser?: (value: string) => Date;
/** Input name, useful for uncontrolled variant to capture data with native form */
name?: string;
/** Set first day of the week */
firstDayOfWeek?: FirstDayOfWeek;
/** Allow free input */
allowFreeInput?: boolean;
/** Render day based on the date */
renderDay?(date: Date): React.ReactNode;
/** Hide now button so that it doesn't interfear with min or max date */
hideNow?: boolean;
/** Hide now button when date is disabled */
autoHideNow?: boolean;
/**Label for now button */
nowLabel?: string;
/**lable for ok button */
okLabel?: string;
}
export declare const DateTimePicker: React.ForwardRefExoticComponent<DateTimePickerProps & React.RefAttributes<HTMLInputElement>>;
export default DateTimePicker;