@ux-aspects/ux-aspects
Version:
Open source user interface framework for building modern, responsive, mobile big data applications
64 lines (63 loc) • 2.41 kB
TypeScript
/**
* Convert a single dimension array to a double dimension array
* @param items the single dimension array to convert
* @param columns the number of items each array should have
*/
export declare function gridify<T>(items: T[], columns: number): T[][];
/**
* Create an array of numbers between two limits
* @param start the lower limit
* @param end the upper limit
*/
export declare function range(start: number, end: number): number[];
/**
* Create an array of dates between two points
* @param start the date to start the array
* @param end the date to end the array
*/
export declare function dateRange(start: Date, end: Date): Date[];
/**
* Compare two dates to see if they are on the same day
* @param day1 the first date to compare
* @param day2 the second date to compare
*/
export declare function compareDays(day1: Date, day2: Date): boolean;
/**
* Date comparison for use primarily with distinctUntilChanged
*/
export declare function dateComparator(dateOne: Date, dateTwo: Date): boolean;
/**
* Calculate the number of days between two dates
* @param start The start date
* @param end The end date
* @param fullDay Whether or not we should take from 00:00 on the start date and 23:59 on the end date
*/
export declare function differenceBetweenDates(start: Date, end: Date, fullDay?: boolean): number | null;
/**
* Timezone comparison for use primarily with distinctUntilChanged
*/
export declare function timezoneComparator(zoneOne: DateTimePickerTimezone, zoneTwo: DateTimePickerTimezone): boolean;
/**
* Get a date object with the time of the start of the given day
* @param date The date to get the start of day
*/
export declare function getStartOfDay(date: Date): Date;
export declare function isDateAfter(date: Date, after: Date, isEqual?: boolean): boolean;
export declare function isDateBefore(date: Date, before: Date, isEqual?: boolean): boolean;
/**
* Export an array of all the available months
*/
export declare const months: string[];
export declare const monthsShort: string[];
/**
* Export an array of all the available days of the week
*/
export declare const weekdays: string[];
export declare const weekdaysShort: string[];
export declare const meridians: string[];
/** Export the default set of time zone */
export declare const timezones: DateTimePickerTimezone[];
export interface DateTimePickerTimezone {
name: string;
offset: number;
}