util.d.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { Dayjs } from 'dayjs';
  2. declare const precisionLengthRecord: {
  3. year: number;
  4. month: number;
  5. day: number;
  6. hour: number;
  7. minute: number;
  8. second: number;
  9. };
  10. export declare function getRangeData(precision: keyof typeof precisionLengthRecord, min: Dayjs, max: Dayjs, currentPickerDay: Dayjs, format: (precision: keyof typeof precisionLengthRecord, value: number) => string): any[];
  11. /**
  12. * 选中的值转换为时间类型,主要处理month从0开始的情况
  13. * @param value
  14. * @returns
  15. */
  16. export declare function getDateByValue(value: any): Date;
  17. /**
  18. * date转换为value数组
  19. * @param value
  20. * @returns
  21. */
  22. export declare function getValueByDate(date: any, precision: keyof typeof precisionLengthRecord): any[];
  23. /**
  24. * 是否有效日期,主要处理月份对应可选日期,避免当前时间日期超出当月最后一天
  25. * @param value
  26. */
  27. export declare function getValidValue(value: any): any;
  28. /**
  29. * 比较两个date是否是同一时间
  30. * @param date1
  31. * @param date2
  32. */
  33. export declare function isEqualDate(date1: any, date2: any): boolean;
  34. export {};