@zubenelakrab/gitstats
Version:
Powerful Git repository analyzer with comprehensive statistics and insights
73 lines • 1.93 kB
TypeScript
/**
* Format a date to ISO date string (YYYY-MM-DD)
*/
export declare function toDateString(date: Date): string;
/**
* Format a date to week key (YYYY-WXX)
*/
export declare function toWeekKey(date: Date): string;
/**
* Format a date to month key (YYYY-MM)
*/
export declare function toMonthKey(date: Date): string;
/**
* Format a date to year key (YYYY)
*/
export declare function toYearKey(date: Date): string;
/**
* Get the start of day for a date
*/
export declare function getDayStart(date: Date): Date;
/**
* Get the start of week for a date
*/
export declare function getWeekStart(date: Date): Date;
/**
* Get the start of month for a date
*/
export declare function getMonthStart(date: Date): Date;
/**
* Get the start of year for a date
*/
export declare function getYearStart(date: Date): Date;
/**
* Get day of week (0-6, Sunday = 0)
*/
export declare function getDayOfWeek(date: Date): number;
/**
* Get hour of day (0-23)
*/
export declare function getHourOfDay(date: Date): number;
/**
* Get week number
*/
export declare function getWeekNumber(date: Date): number;
/**
* Get month (0-11)
*/
export declare function getMonthNumber(date: Date): number;
/**
* Get year
*/
export declare function getYearNumber(date: Date): number;
/**
* Calculate difference in days between two dates
*/
export declare function daysDifference(dateA: Date, dateB: Date): number;
/**
* Calculate difference in calendar days between two dates
*/
export declare function calendarDaysDifference(dateA: Date, dateB: Date): number;
/**
* Parse an ISO date string to Date
*/
export declare function parseDate(dateString: string): Date;
/**
* Format a date for display
*/
export declare function formatDate(date: Date, formatStr?: string): string;
/**
* Get a human-readable relative time (e.g., "2 days ago")
*/
export declare function getRelativeTime(date: Date): string;
//# sourceMappingURL=date.d.ts.map