material-ui-pickers-v4
Version:
React components, that implements material design pickers for material-ui v4 with updated material ui
34 lines (33 loc) • 1.72 kB
TypeScript
/// <reference types="react" />
import { Omit } from './utils';
import { DatePickerProps } from '..';
import { IUtils } from '@date-io/core/IUtils';
import { ParsableDate } from '../constants/prop-types';
import { BasePickerProps } from '../typings/BasePicker';
export declare const getDisplayDate: (value: ParsableDate, format: string, utils: IUtils<any>, isEmpty: boolean, { invalidLabel, emptyLabel, labelFunc }: Omit<BasePickerProps, 'value' | 'onChange'>) => string;
export interface BaseValidationProps {
/**
* Message, appearing when date cannot be parsed
* @default 'Invalid Date Format'
*/
invalidDateMessage?: React.ReactNode;
}
export interface DateValidationProps extends BaseValidationProps {
/**
* Error message, shown if date is less then minimal date
* @default 'Date should not be before minimal date'
*/
minDateMessage?: React.ReactNode;
/**
* Error message, shown if date is more then maximal date
* @default 'Date should not be after maximal date'
*/
maxDateMessage?: React.ReactNode;
}
export declare const validate: (value: ParsableDate, utils: IUtils<any>, { maxDate, minDate, disablePast, disableFuture, maxDateMessage, minDateMessage, invalidDateMessage, strictCompareDates, }: Omit<DatePickerProps, 'views' | 'openTo'>) => React.ReactNode;
export declare function pick12hOr24hFormat(userFormat: string | undefined, ampm: boolean | undefined, formats: {
'12h': string;
'24h': string;
}): string;
export declare function makeMaskFromFormat(format: string, numberMaskChar: string): string;
export declare const maskedDateFormatter: (mask: string, numberMaskChar: string, refuse: RegExp) => (value: string) => string;