import { InjectionToken } from '@angular/core'; import { VCLDateAdapterParseFormats, VCLDateAdapterDisplayFormats, VCLDateRange } from './interfaces'; export declare const VCL_DATE_ADAPTER: InjectionToken; export declare const VCL_DATE_ADAPTER_WEEKDAY_OFFSET: InjectionToken; export declare abstract class VCLDateAdapter { daysPerWeek: number; abstract locale?: string; abstract weekDayOffset: number; abstract isDate(date: any): date is VCLDate; /** * Checks if value is an array with valid dates */ isDateArray(date: any): date is VCLDate[]; /** * Checks if value is a valid date range */ isRange(date: any): date is VCLDateRange; /** * Checks if value is a date range consisting of at least a starting date */ isPartialRange(date: any): date is VCLDateRange; /** * Checks if defined locale is in 24h format */ abstract use24hTime(): boolean; /** * Returns a date representing today's date */ abstract today(): VCLDate; /** * Returns a the latest possible date */ abstract max(): VCLDate; /** * Returns a the earliest possible date */ abstract min(): VCLDate; /** * Returns a date range that represents all possible dates */ always(): VCLDateRange; /** * Clones a Date */ abstract clone(date: VCLDate): VCLDate; /** * Parses a date string in specified format and returns a VCLDate instance */ abstract parse(date: string, format: VCLDateAdapterParseFormats): VCLDate | undefined; /** * Formats a VCLDate tp the specified format and returns it as a string */ abstract format(date: VCLDate, format: VCLDateAdapterDisplayFormats): string | undefined; abstract addMonths(date: VCLDate, months: number): VCLDate; abstract addDays(date: VCLDate, days: number): VCLDate; abstract getDaysInMonth(date: VCLDate): number; abstract getYear(date: VCLDate): number; abstract getMonth(date: VCLDate): number; abstract getDay(date: VCLDate): number; abstract getHour(date: VCLDate): number; abstract getMinute(date: VCLDate): number; abstract getDayOfWeek(date: VCLDate): number; abstract getWeekOfTheYear(date: VCLDate): number; abstract getDayOfWeekNames(): string[]; abstract createDate(year: number, month: number, day: number): VCLDate; abstract createDateTime(year: number, month: number, day: number, hour: number, minute: number, second: number): VCLDate; abstract createTime(hour: number, minute: number, second: number): VCLDate; getFirstWeekdayOfMonth(date: VCLDate): number; getLastWeekdayOfMonth(date: VCLDate): number; /** * @returns 0 if equal, less than 0 if the first date is earlier, greater than 0 if the first date is later. */ compareDate(date1: VCLDate, date2: VCLDate): number; /** * @returns 0 if equal, less than 0 if the first date's month is earlier, greater than 0 if the first date's month is later. */ compareMonth(date1: VCLDate, date2: VCLDate): number; /** * @returns 0 if equal, less than 0 if the first date's year is earlier, greater than 0 if the first date's year is later. */ compareYear(date1: VCLDate, date2: VCLDate): number; isSameMonth(date1: VCLDate, date2: VCLDate): boolean; isSameYear(date1: VCLDate, date2: VCLDate): boolean; addYears(date: VCLDate, years: number): VCLDate; isSameDay(date1: VCLDate, date2: VCLDate): boolean; createRange(start: VCLDate, end?: VCLDate): VCLDateRange; toDate(date: any): VCLDate | undefined; }