Skip to content

DisabledDates not working #601

Answered by t1m0n
algomera asked this question in Q&A
Mar 21, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

@algomera Hi. disabledDates is a property of AirDatepicker instance, it's not an option. If you would like to have some dates disabled on start, you can use onRenderCell option and return {disabled: true} when you want this or that date to be disabled.

Another way to disabled dates is using disabledDate method:

const dp = new AirDatepicker('el');

dp.disableDate('2024-03-23')
// or passing array if you need multiple dates to be disabled
dp.disableDate(['2024-03-23', '2024-03-24'])

// After you can access all disabled dates like this
console.log(dp.disabledDates)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@algomera
Comment options

Answer selected by algomera
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants