igniteui-angular
Version:
Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps
56 lines (55 loc) • 1.82 kB
TypeScript
export type DayParameter = CalendarDay | Date;
export type CalendarRangeParams = {
start: DayParameter;
end: DayParameter | number;
unit?: DayInterval;
};
type CalendarDayParams = {
year: number;
month: number;
date?: number;
};
export type DayInterval = "year" | "quarter" | "month" | "week" | "day";
export declare const daysInWeek = 7;
export declare function toCalendarDay(date: DayParameter): CalendarDay;
export declare class CalendarDay {
private _date;
/** Constructs and returns the current day. */
static get today(): CalendarDay;
/** Constructs a new CalendarDay instance from a Date object. */
static from(date: Date): CalendarDay;
constructor(args: CalendarDayParams);
/** Returns a copy of this instance. */
clone(): CalendarDay;
/**
* Returns a new instance with values replaced.
*/
set(args: Partial<CalendarDayParams>): CalendarDay;
add(unit: DayInterval, value: number): CalendarDay;
/** Returns the day of the week (Sunday = 0). */
get day(): number;
/** Returns the full year. */
get year(): number;
/** Returns the month. */
get month(): number;
/** Returns the date */
get date(): number;
/** Returns the timestamp since epoch in milliseconds. */
get timestamp(): number;
/** Returns the current week number. */
get week(): number;
/** Returns the underlying native date instance. */
get native(): Date;
/**
* Whether the current date is a weekend day.
*
* @remarks
* This is naive, since it does not account for locale specifics.
*/
get weekend(): boolean;
equalTo(value: DayParameter): boolean;
greaterThan(value: DayParameter): boolean;
lessThan(value: DayParameter): boolean;
toString(): string;
}
export {};