Lightweight, dependency-free JavaScript datepicker.
Lightweight, dependency-free, fast, customizable datepicker written in pure JavaScript. Works in all modern browsers which supports native css variables.
npm i air-datepicker
import AirDatepicker from 'air-datepicker'
import 'air-datepicker/air-datepicker.css'
new AirDatepicker('#el' [, options]);
destroy()
behavior - added isDestroyed
property, opts
and selectedDates
will still have empty values, instead of null
, even after AirDatepicker has been destroyed #600fixedHeight
option, allows you to have equal weeks number in every monthdisableDate
, allows you to disabled one or multiple dates with datepicker APIdisabledDates
- it is a Set which holds all disabled dates{silent: true}
to update
and setCurrentView
methods, #583update
method - now if you pass selectedDates
then calendar will keep selected only those datesrange: true
, #568selectDate('2024-03-05')
#589clear
method, thanks to ahmetzambak in #591onFocus
and onBeforeSelect
grant you more control over range selection behaviour and more #526getViewDates()
allows you to get all dates that should be currently displayed in calendar #536toggleSelected
now can be a function #534clear
method #546It is been a while since the last release, a lot of work has been done, and I’m glad to finally present a new version of Air Datepicker.
The main goal was to remove jQuery dependency, and I’m happy to announce that Air Datepicker is no longer need any dependency, hurray! 🥳
Now it’s written in ES6, uses native css variables for easy customization, and it’s all built with webpack.
Soooo, here is the full list of changes:
selectedDates
option, to be able to select dates from the startcontainer
option which allows you to place datepicker in a custom elementnavTitles
can receive a function and could render dynamicallydateFormat
now can receive a functiononSelect
and onRenderCell
callbacks are now receive a single object as an argument instead of multiple parametersselectDate
now receives second parameter with optionsonChangeMonth
, onChangeYear
, onChangeDecades
are replaced with single option onChangeViewDate
npm i
, then npm run dev:serve
.air-datepicker
Thank you! 😊
Air Datepicker is MIT licensed.