@kelvininc/ui-components
Version:
Kelvin UI Components
19 lines (18 loc) • 1.37 kB
TypeScript
import dayjs from 'dayjs';
import { IRelativeTimePickerOption } from '../types';
import { DayjsTimeRange, TimestampRange } from './types';
/** Date range builders */
export declare const buildOptionRange: (option: IRelativeTimePickerOption, timeZone: string) => DayjsTimeRange;
export declare const buildStartDateEndDateConfigRange: (option: IRelativeTimePickerOption, timeZone: string) => DayjsTimeRange;
export declare const buildSingleDateConfigRange: (option: IRelativeTimePickerOption, timeZone: string) => DayjsTimeRange;
export declare const buildAbsoluteAmountOfUnitsConfigRange: (option: IRelativeTimePickerOption, timeZone: string) => DayjsTimeRange;
export declare const buildRelativeAmountOfUnitsConfigRange: (option: IRelativeTimePickerOption, timeZone: string) => DayjsTimeRange;
/**
* Builds the range of the start and end date and returns the range array, ordering the dates if needed
* @param dateA date (start or end)
* @param dateB date (start or end)
* @returns range containing start date and end date ordered
*/
export declare const buildDayjsRange: (dateA: dayjs.Dayjs, dateB: dayjs.Dayjs) => DayjsTimeRange;
export declare const buildTimestampRange: ([startDate, endDate]: DayjsTimeRange) => TimestampRange;
export declare const getRelativeTimeOption: (key: string, options?: IRelativeTimePickerOption[][]) => IRelativeTimePickerOption;