Methods
init()
The init()
method is the main instance method that starts the calendar initialization process.
update()
The update()
method allows you to apply new settings to the calendar and perform a reset.
This method accepts an object with optional arguments to control the reset, by default resetting the user-selected date, month, and year after the update.
All arguments default to true
:
true
- will reset to the parameters specified in the settings;false
- will not perform a reset, leaving the parameters selected by the user;'only-first'
- resets all selected dates, leaving only the earliest one. If the date selection type is specified as'multiple-ranged'
, a'mousemove'
and'keydown'
handler is added for hovering.
Example usage:
set()
If you need to specify new parameters or handlers for a calendar that is not yet initialized or already initialized, you can use the .set()
method.
This method accepts an object with new parameters and an object with optional arguments to control the reset, by default resetting the user-selected date, month, and year after the update.
Example usage:
This method can be an alternative to specifying parameters when creating a calendar instance. If you call this method before initialization, do not specify the object for controlling the reset.
destroy()
If you need to completely delete the calendar instance, you can use the destroy()
method.
show()
The show()
method allows you to display the calendar if it was hidden.
hide()
The hide()
method allows you to hide the calendar if it was shown.