ts-time-utils
Version:
A comprehensive TypeScript utility library for time, dates, durations, and calendar operations with full tree-shaking support
62 lines • 1.78 kB
TypeScript
/**
* Check if a date is valid
* @param date - date to validate
*/
export declare function isValidDate(date: Date | string | number): boolean;
/**
* Check if a year is a leap year
* @param year - year to check
*/
export declare function isLeapYear(year: number): boolean;
/**
* Check if a date is in the past
* @param date - date to check
*/
export declare function isPast(date: Date): boolean;
/**
* Check if a date is in the future
* @param date - date to check
*/
export declare function isFuture(date: Date): boolean;
/**
* Check if a date is today
* @param date - date to check
*/
export declare function isToday(date: Date): boolean;
/**
* Check if a date is yesterday
* @param date - date to check
*/
export declare function isYesterday(date: Date): boolean;
/**
* Check if a date is tomorrow
* @param date - date to check
*/
export declare function isTomorrow(date: Date): boolean;
/**
* Check if two dates are the same day
* @param date1 - first date
* @param date2 - second date
*/
export declare function isSameDay(date1: Date, date2: Date): boolean;
/**
* Check if a date is a weekend (Saturday or Sunday)
* @param date - date to check
*/
export declare function isWeekend(date: Date): boolean;
/**
* Check if a date is a weekday (Monday through Friday)
* @param date - date to check
*/
export declare function isWeekday(date: Date): boolean;
/**
* Check if a time string is valid (HH:MM or HH:MM:SS format)
* @param time - time string to validate
*/
export declare function isValidTimeString(time: string): boolean;
/**
* Check if a date string is valid ISO 8601 format
* @param dateString - date string to validate
*/
export declare function isValidISOString(dateString: string): boolean;
//# sourceMappingURL=validate.d.ts.map