Copyright © 2023 MIT License. | Design and development by Yury Uvarov.
Main

Main settings

The main parameters are responsible for the most important changes.

input

Type: Boolean

Default: false

Options: true | false

js
new VanillaCalendar('#calendar', {
  input: true,
});
js
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'

js
new VanillaCalendar('#calendar', {
  type: 'default',
});
js
new VanillaCalendar('#calendar', {
  type: 'default',
});

The type of calendar to display.


months

Type: Number

Default: 2

Options: from 2 to 12

js
new VanillaCalendar('#calendar', {
  months: 2,
});
js
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 ∞

js
new VanillaCalendar('#calendar', {
  jumpMonths: 1,
});
js
new VanillaCalendar('#calendar', {
  jumpMonths: 1,
});

Number of switchable months.


date.min

Type: String

Default: '1970-01-01'

Options: 'YYYY-MM-DD'

js
new VanillaCalendar('#calendar', {
  date: {
    min: '1970-01-01',
  },
});
js
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'

js
new VanillaCalendar('#calendar', {
  date: {
    max: '2470-12-31',
  },
});
js
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()

js
new VanillaCalendar('#calendar', {
  date: {
    today: new Date('2022-01-07'),
  },
});
js
new VanillaCalendar('#calendar', {
  date: {
    today: new Date('2022-01-07'),
  },
});

Specifies which day the calendar will consider today.