@nestjstools/clock
Version:
A lightweight, test-friendly clock abstraction for NestJS apps enabling flexible time management via dependency injection
23 lines (22 loc) • 787 B
TypeScript
export declare class CalendarDate {
private readonly year;
private readonly month;
private readonly day;
private constructor();
static fromString(dateString: string): CalendarDate;
static today(): CalendarDate;
static fromDate(date: Date): CalendarDate;
static isValidDate(year: number, month: number, day: number): boolean;
toString(): string;
getYear(): number;
getMonth(): number;
getDay(): number;
equals(other: CalendarDate): boolean;
toDate(): Date;
addDays(days: number): CalendarDate;
subtractDays(days: number): CalendarDate;
isBefore(other: CalendarDate): boolean;
isAfter(other: CalendarDate): boolean;
isSameOrBefore(other: CalendarDate): boolean;
isSameOrAfter(other: CalendarDate): boolean;
}