UNPKG

@ucloud-pccl/react-components

Version:
18 lines (17 loc) 912 B
import { Moment } from 'moment'; import { TDate } from '@z-r/calendar/types/interface'; import { isDateDisabled, getValidDate } from 'src/components/Calendar/utils'; type Range = [TDate | void | null, TDate | void | null]; 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; declare const isRangeDateValid: (value: [TDate | null, TDate | null], rules: { range?: Range | undefined; maxRange?: any; minRange?: any; }, precision?: Precision | null) => true | "rangeError" | "startGreaterThanEnd" | "maxRangeError" | "minRangeError"; declare const isDateValid: (date: TDate, value?: TDate | null, rules?: Rules) => boolean | undefined; export { isDateDisabled, getValidDate, isDateValid, isRangeDateValid };