pig-dam-core
Version:
Library that should be included in every Pig DAM project we build
35 lines • 1 kB
TypeScript
/**
* Date: 3/24/18
* Time: 3:40 AM
* @license MIT (see project's LICENSE file)
*
*/
/**
* Offsets <param>data</param>
*/
export declare function dateAdd(date: Date, { days, hours, millis, minutes, seconds }: {
days?: number;
hours?: number;
millis?: number;
minutes?: number;
seconds?: number;
}): Date;
/**
* Safely compares dates
*/
export declare function datesAreEqual(date1?: Date | null, date2?: Date | null): boolean;
/**
* Does all he can to convert a string into a date object
* @throws {Error}
*/
export declare function dateFromString(text?: string | null): Date | undefined;
/**
* Looks for the various known flavors of a date: Date, String, Number (assumes epoch)
* @throws {Error}
*/
export declare function dateFromValue(value?: Date | number | string | null): Date | undefined;
/**
* Allows support for older encodings without millis
*/
export declare function dateToISOString(date: Date, millis?: boolean): string;
//# sourceMappingURL=date.d.ts.map