@ipi-soft/ng-components
Version:
Custom Angular Components
81 lines (80 loc) • 3.03 kB
TypeScript
import { ValidatorFn } from '@angular/forms';
import * as i0 from "@angular/core";
export declare class IpiDatepickerService {
DAYS_PER_WEEK: number;
yearsPerRow: number;
yearsPerPage: number;
private dateLocale;
formatter: Intl.DateTimeFormat;
dateFormats: {
display: {
dateInput: {
year: string;
month: string;
day: string;
};
monthLabel: {
month: string;
};
monthYearLabel: {
year: string;
month: string;
};
dateA11yLabel: {
year: string;
month: string;
day: string;
};
monthYearA11yLabel: {
year: string;
month: string;
};
};
};
today(): Date;
getDate(date: Date): number;
getMonth(date: Date): number;
getYear(date: Date): number;
getDayOfWeek(date: Date): number;
getDateLocale(): string;
setDateLocale(value: string): void;
getMonthNames(style: 'long' | 'short' | 'narrow'): string[];
getFirstDayOfWeek(): number;
getValidDateOrNull(obj: unknown): Date | null;
getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[];
getDateNames(): string[];
getYearName(date: Date): string;
getNumDaysInMonth(date: Date): number;
createDate(year: number, month: number, date: number): Date;
addCalendarDays(date: Date, days: number): Date;
addCalendarMonths(date: Date, months: number): Date;
addCalendarYears(date: Date, years: number): Date;
setTime(date: Date, hours: number, minutes: number): Date;
sameDate(first: Date | null, second: Date | null): boolean;
/**
* Compares two dates.
* @param first The first date to compare.
* @param second The second date to compare.
* @returns 0 if the dates are equal, a number less than 0 if the first date is earlier,
* a number greater than 0 if the first date is later.
*/
compareDate(first: Date, second: Date): number;
deserialize(value: any): Date | null;
clampDate(date: Date, min?: Date | null, max?: Date | null): Date;
formatDate(date: Date, displayFormat: Object): string;
minValidator(minDate: Date): ValidatorFn;
maxValidator(maxDate: Date): ValidatorFn;
/** Creates a date but allows the month and date to overflow. */
private createDateWithOverflow;
private format;
private isDateInstance;
private isValid;
private invalid;
getActiveOffset<D>(activeDate: Date, minDate: Date | null, maxDate: Date | null): number;
private getStartingYear;
positiveModulo(a: number, b: number): number;
isSameMultiYearView<D>(date1: Date, date2: Date, minDate: Date | null, maxDate: Date | null): boolean;
private range;
static ɵfac: i0.ɵɵFactoryDeclaration<IpiDatepickerService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IpiDatepickerService>;
}