import '../static/css/calendar.css'; export declare type OnChange = (value: Date) => void; interface CalendarOptions { date?: Date; min?: Date; max?: Date; } export default class CalendarPicker { date: Date; day: number; month: number; year: number; today: Date; value: Date; min: Date | undefined; max: Date | undefined; userElement: HTMLElement; calendarWrapper: HTMLElement; calendarElement: HTMLElement; calendarHeader: HTMLElement; calendarHeaderTitle: HTMLElement; navigationWrapper: HTMLElement; previousMonthArrow: HTMLElement; nextMonthArrow: HTMLElement; calendarGridDays: HTMLElement; calendarGrid: HTMLElement; calendarDayElementType: string; activeDateElement: HTMLElement | null; listOfAllDaysAsText: string[]; listOfAllMonthsAsText: string[]; dayAsText: string; monthAsText: string; dateAsText: string; yearAsText: string; callback: OnChange | null; constructor(element: HTMLElement, options: CalendarOptions); setCallback: (callback: OnChange) => void; /** * @param {Number} The month number, 0 based. * @param {Number} The year, not zero based, required to account for leap years. * @return {Array} List with date objects for each day of the month. * @author Juan Mendes - 30th October 2012. */ _getDaysInMonth: (month: number, year: number) => Date[]; /** * @param {DateObject} date. * @description Sets the clock of a date to 00:00:00 to be consistent. */ _formatDateToInit: (date?: Date | undefined) => void; /** * @description Sets the current date as readable text in their own variables */ _setDateText: () => void; /** * @description Inserts the calendar into the wrapper and adds eventListeners for the calender-grid. */ _insertCalendarIntoWrapper: () => void; /** * @description Adds the "main" calendar-header. */ _insertHeaderIntoCalendarWrapper: () => void; /** * @description Inserts the calendar-grid header with all the weekdays. */ _insertCalendarGridDaysHeader: () => void; /** * @description Adds the "Previous" and "Next" arrows on the side-navigation. * Also inits the click-events used to navigating. */ _insertNavigationButtons: () => void; /** * @description Adds all the days for current month into the calendar-grid. * Takes into account which day the month starts on, so that "empty/placeholder" days can be added * in case the month for example starts on a Thursday. * Also disables the days that are not within the provided. */ _insertDaysIntoGrid: () => void; /** * @description Updates the core-values for the calendar based on the new month and year * given by the navigation. Also updates the UI with the new values. */ _updateCalendar: () => void; focus(): void; /** * @param {Function} callback * @description A "listener" that lets the user do something everytime the value changes. */ onValueChange: () => false | void; } export {};