@ucloud-fe/react-components
Version:
UCloud react components
19 lines (18 loc) • 1.05 kB
TypeScript
import { Moment } from 'moment';
import { TDate } from '@ucloud-fe/calendar';
import { isDateDisabled, getValidDate } from '../../components/Calendar/utils';
declare type Range = [TDate | void | null, TDate | void | null];
export declare type Precision = 'second' | 'minute' | 'hour' | 'date' | 'month' | 'year';
export interface Rules {
range?: Range;
custom?: (date: Moment, value?: Moment | null) => boolean;
}
export declare const formatToShort: (format: string) => string;
export declare const setPrecision: (v: TDate, precision?: Precision | undefined) => TDate;
declare const isRangeDateValid: (value: [TDate | null, TDate | null], rules: {
range?: Range | undefined;
maxRange?: any;
minRange?: any;
}, precision?: Precision | null | undefined) => true | "rangeError" | "startGreaterThanEnd" | "maxRangeError" | "minRangeError";
declare const isDateValid: (date: TDate, value?: TDate | null | undefined, rules?: Rules | undefined) => boolean | undefined;
export { isDateDisabled, getValidDate, isDateValid, isRangeDateValid };