UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

17 lines (15 loc) 664 B
declare const isSameMonth: (date1?: Date, date2?: Date) => boolean; declare const isToday: (date: Date) => boolean; declare enum SortDirection { ASC = "ASC", DESC = "DESC" } declare function sortByDate<T>(a: T, b: T, key: keyof T, direction?: SortDirection): 0 | 1 | -1; type SortOptions = { locale?: string; shouldIgnoreZero?: boolean; }; declare function sortData(a: unknown, b: unknown, direction?: SortDirection | null, options?: SortOptions): number; declare const suffixAmPm: (h: number) => string; declare const getQuarter: (d?: Date) => number; export { SortDirection, getQuarter, isSameMonth, isToday, sortByDate, sortData, suffixAmPm };