UNPKG

coveo-search-ui-extensions

Version:

Small generic components to extend the functionality of Coveo's Search UI framework.

49 lines (48 loc) 1.95 kB
/** * Format a date object to a date string that follow the format describe below. * > Ex: `Mon, Apr 29, 2019` * @param date The date that will be formated. * @returns A string formated version of the date. */ export declare function formatDate(date: Date): string; /** * Format a date object to a short date string that follow the format describe below. * > Ex: `Apr 29` * @param date The date that will be formated. * @returns A string formated version of the date. */ export declare function formatDateShort(date: Date): string; /** * Format a date object to a time string that follow the format describe below. * > Ex: `12:00:00 PM` * @param date The date that will be formated. * @returns A string formated version of the time. */ export declare function formatTime(date: Date): string; /** * Format a date object to a short time string that follow the format describe below. * > Ex: `12:00 PM` * @param date The date that will be formated. * @returns A string formated version of the time. */ export declare function formatTimeShort(date: Date): string; /** * Format a date object to a date and time string that follow the format describe below. * > Ex: `Mon, Apr 29, 2019 - 12:00 PM` * @param date The date that will be formated. * @returns A string formated version of the date and time. */ export declare function formatDateAndTime(date: Date): string; /** * Format a date object to a date and time string that follow the format describe below. * > Ex: `Apr 29 - 12:00 PM` * @param date The date that will be formated. * @returns A string formated version of the date and time. */ export declare function formatDateAndTimeShort(date: Date): string; /** * Format a time interval to a user friendly string format. * > Ex: `5 minutes 10 seconds` * @param interval The time interval in milliseconds to format in a user friendly fashion. */ export declare function formatTimeInterval(interval: number): string;