Readonly options
After the calendar is initialized, additional read-only settings are created.
These parameters contain a set of data on the current state of the calendar.
The state of the calendar changes each time you interact with the calendar. Accordingly, the dataset will be overwritten, so these properties are read-only.
HTMLElement
Type: HTMLElement
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.HTMLElement);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.HTMLElement);
The root html element where the calendar was initialized.
HTMLInputElement
Type: HTMLElement
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.HTMLInputElement);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.HTMLInputElement);
The root html element that is the input field.
currentType
Type: string
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.currentType);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.currentType);
The current calendar type.
dateMin
Type: Date
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.dateMin);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.dateMin);
The minimum date in the Date
format of the object.
dateMax
Type: Date
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.dateMax);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.dateMax);
The maximum date in the Date
format of the object.
rangeMin
Type: string
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.rangeMin);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.rangeMin);
The current minimum date.
rangeMax
Type: string
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.rangeMax);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.rangeMax);
The current maximum date.
rangeDisabled
Type: string[]
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.rangeDisabled);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.rangeDisabled);
An array of disabled dates.
rangeEnabled
Type: string[]
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.rangeEnabled);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.rangeEnabled);
An array of enabled dates.
selectedDates
Type: string[]
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedDates);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedDates);
An array of currently selected dates.
selectedHolidays
Type: string[]
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedHolidays);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedHolidays);
An array of holidays.
selectedMonth
Type: number
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedMonth);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedMonth);
The currently selected month.
selectedYear
Type: number
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedYear);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedYear);
The current selected year.
selectedHours
Type: string
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedHours);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedHours);
The currently selected hour.
selectedMinutes
Type: string
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedMinutes);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedMinutes);
The currently selected minutes.
selectedKeeping
Type: string | null
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedKeeping);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedKeeping);
Current AM/PM marker for 12-hour time format.
selectedTime
Type: string | null
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedTime);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.selectedTime);
Current full time.
userTime
Type: boolean
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.userTime);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.userTime);
Specifies how the time was set when the calendar was initialized. Autodetect the current time (default) or use the settings.selected.time
option.
correctMonths
Type: number
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.correctMonths);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.correctMonths);
The current number of months to display if the calendar type is 'multiple'
.
viewYear
Type: number
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.viewYear);
const calendar = new VanillaCalendar('#calendar');
console.log(calendar.viewYear);
The current display year.