Main settings
The main parameters are responsible for the most important changes.
input
Type: Boolean
Default: false
Options: true | false
new VanillaCalendar('#calendar', {
input: true,
});
new VanillaCalendar('#calendar', {
input: true,
});
Indicates that the HTMLElement
passed as the first parameter is an input field, not a calendar wrapper.
type
Type: String
Default: 'default'
Options: 'default' | 'multiple' | 'month' | 'year'
new VanillaCalendar('#calendar', {
type: 'default',
});
new VanillaCalendar('#calendar', {
type: 'default',
});
The type of calendar to display.
months
Type: Number
Default: 2
Options: from 2 to 12
new VanillaCalendar('#calendar', {
months: 2,
});
new VanillaCalendar('#calendar', {
months: 2,
});
Specifies the number of months to display if the calendar type is 'multiple'
.
jumpMonths
Type: Number
Default: 1
Options: from 1 to ∞
new VanillaCalendar('#calendar', {
jumpMonths: 1,
});
new VanillaCalendar('#calendar', {
jumpMonths: 1,
});
Number of switchable months.
date.min
Type: String
Default: '1970-01-01'
Options: 'YYYY-MM-DD'
new VanillaCalendar('#calendar', {
date: {
min: '1970-01-01',
},
});
new VanillaCalendar('#calendar', {
date: {
min: '1970-01-01',
},
});
The minimum possible date that the calendar will take into account in its life cycle, which means that there will be no dates less than this.
date.max
Type: String
Default: '2470-12-31'
Options: 'YYYY-MM-DD'
new VanillaCalendar('#calendar', {
date: {
max: '2470-12-31',
},
});
new VanillaCalendar('#calendar', {
date: {
max: '2470-12-31',
},
});
Like data.min
, this parameter is responsible for the life cycle of the calendar. Sets the maximum possible date.
date.today
Type: Date object
Default: new Date()
Options: new Date()
new VanillaCalendar('#calendar', {
date: {
today: new Date('2022-01-07'),
},
});
new VanillaCalendar('#calendar', {
date: {
today: new Date('2022-01-07'),
},
});
Specifies which day the calendar will consider today.