dateUtil.d.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233
  1. import type { PanelMode, NullableDateType, PickerMode, Locale, CustomFormat } from '../interface';
  2. import type { GenerateConfig } from '../generate';
  3. export declare const WEEK_DAY_COUNT = 7;
  4. export declare function isNullEqual<T>(value1: T, value2: T): boolean | undefined;
  5. export declare function isSameDecade<DateType>(generateConfig: GenerateConfig<DateType>, decade1: NullableDateType<DateType>, decade2: NullableDateType<DateType>): boolean;
  6. export declare function isSameYear<DateType>(generateConfig: GenerateConfig<DateType>, year1: NullableDateType<DateType>, year2: NullableDateType<DateType>): boolean;
  7. export declare function getQuarter<DateType>(generateConfig: GenerateConfig<DateType>, date: DateType): number;
  8. export declare function isSameQuarter<DateType>(generateConfig: GenerateConfig<DateType>, quarter1: NullableDateType<DateType>, quarter2: NullableDateType<DateType>): boolean;
  9. export declare function isSameMonth<DateType>(generateConfig: GenerateConfig<DateType>, month1: NullableDateType<DateType>, month2: NullableDateType<DateType>): boolean;
  10. export declare function isSameDate<DateType>(generateConfig: GenerateConfig<DateType>, date1: NullableDateType<DateType>, date2: NullableDateType<DateType>): boolean;
  11. export declare function isSameTime<DateType>(generateConfig: GenerateConfig<DateType>, time1: NullableDateType<DateType>, time2: NullableDateType<DateType>): boolean;
  12. export declare function isSameWeek<DateType>(generateConfig: GenerateConfig<DateType>, locale: string, date1: NullableDateType<DateType>, date2: NullableDateType<DateType>): boolean;
  13. export declare function isEqual<DateType>(generateConfig: GenerateConfig<DateType>, value1: NullableDateType<DateType>, value2: NullableDateType<DateType>): boolean;
  14. /** Between in date but not equal of date */
  15. export declare function isInRange<DateType>(generateConfig: GenerateConfig<DateType>, startDate: NullableDateType<DateType>, endDate: NullableDateType<DateType>, current: NullableDateType<DateType>): boolean;
  16. export declare function getWeekStartDate<DateType>(locale: string, generateConfig: GenerateConfig<DateType>, value: DateType): DateType;
  17. export declare function getClosingViewDate<DateType>(viewDate: DateType, picker: PickerMode, generateConfig: GenerateConfig<DateType>, offset?: number): DateType;
  18. export declare function formatValue<DateType>(value: DateType, { generateConfig, locale, format, }: {
  19. generateConfig: GenerateConfig<DateType>;
  20. locale: Locale;
  21. format: string | CustomFormat<DateType>;
  22. }): string;
  23. export declare function parseValue<DateType>(value: string, { generateConfig, locale, formatList, }: {
  24. generateConfig: GenerateConfig<DateType>;
  25. locale: Locale;
  26. formatList: (string | CustomFormat<DateType>)[];
  27. }): DateType;
  28. export declare function getCellDateDisabled<DateType>({ cellDate, mode, disabledDate, generateConfig, }: {
  29. cellDate: DateType;
  30. mode: Omit<PanelMode, 'time'>;
  31. generateConfig: GenerateConfig<DateType>;
  32. disabledDate?: (date: DateType) => boolean;
  33. }): boolean;