@kelvininc/ui-components
Version:
Kelvin UI Components
17 lines (16 loc) • 1.43 kB
TypeScript
import { IDateTimeRangeFormatter, IRelativeTimeDropdownOption, IRelativeTimePickerOption } from './relative-time-picker.types';
import { DayjsTimeRange, ISelectSingleOptions, ITimezoneOffset, SelectedTimestamp } from '../../types';
export declare const buildRelativeTimeSelectOptions: (options: IRelativeTimePickerOption[][], timeZone?: string) => IRelativeTimeDropdownOption[][];
export declare const buildRelativeTimeGroupOptions: (options: IRelativeTimePickerOption[], timeZone: string) => IRelativeTimeDropdownOption[];
/**
* Builds the description of the date
* @param startDate start date
* @param endDate end date
* @param formatObject specifies how the dates and the separators should be read
* @returns description of the range accordingly with the format object
*/
export declare const buildDateRangeDescription: ([startDate, endDate]: DayjsTimeRange, formatObject: IDateTimeRangeFormatter) => string;
export declare const getSelectedKeyRange: (options: IRelativeTimeDropdownOption[][], key: string) => SelectedTimestamp;
export declare const hasRangeChanged: (selectedRange: SelectedTimestamp, currentRange: SelectedTimestamp) => boolean;
export declare const isScrollNeeded: (options: IRelativeTimePickerOption[][], displayingCustomizeOption: boolean, displayingTimezoneDropdown: boolean) => boolean;
export declare const buildTimezonesDropdownOptions: (timezones: ITimezoneOffset[]) => ISelectSingleOptions;