@porscheinformatik/clr-addons
Version:
Addon components for Clarity Angular
81 lines (80 loc) • 2.35 kB
TypeScript
/**
* Day model.
* Takes care of keeping records of full days, without the times & timezone issues.
*/
export declare class DayModel {
/** Year. */
private year;
/** Month, zero-indexed. */
private month;
/** Date of the month. */
private date;
/**
* Creates an day model.
* @param year - The full year.
* @param month - The month as a number between 0 and 11 (January to December).
* @param date - The date as a number between 1 and 31.
*/
constructor(year: number, month: number, date: number);
/**
* Creates an day model.
* @param date - Javascript Date object.
*/
constructor(date: Date);
/**
* Creates an day model.
* @param date - Date string in `yyyy-mm-dd` format.
*/
constructor(date: string);
/**
* Checks if the passed value is equal to current day model.
* @param value - Day model.
* @returns Wether value is equal to current day model.
*/
isEqual(value: DayModel): boolean;
/**
* Increment day model with date value.
* @param value - Incremental date value.
* @returns Updated day model with incremented date value.
*/
incrementBy(value: number): DayModel;
/**
* Checks if current day model is after value.
* @param value - Day model.
* @returns Wether current day model is after value.
*/
isAfter(value: DayModel): boolean;
/**
* Checks if current day model is before value.
* @param value - Day model.
* @returns Wether current day model is before value.
*/
isBefore(value: DayModel): boolean;
/**
* Clones the current day model.
* @returns Cloned day model.
*/
clone(): DayModel;
/**
* Convert to Javascript Date object.
* @returns Javascript Date object.
*/
toDate(): Date;
/**
* To HTML5 date spec string.
* See https://clarity.design/documentation/datepicker
* @returns Date as HTML5 spec string.
*/
toHTML5SpecDateString(): string;
/**
* String padding with zeros.
* @param num - Number to pad.
* @returns Padded string.
*/
private pad;
}
/**
* Day model.
* Takes care of keeping records of full days, without the times & timezone issues.
*/
export type NullableDayModel = DayModel | undefined | null;