I have been using beatpicker. I had got into a situation wherein I need to enable only 1 date in a month for the current year. And the date has to be enabled after today's date.
So if I'm in March Feb and Jan date needs to be disabled.
The beatpicker has few limitations it has a limit on the number of items that can be mentioned in the disablingRules and another is lets say if I say
{ from: [*, *, 2], to: [*, *, 31] },
For months which has less than 31 days the date logic gets overflowed to the next month.
After trying various combinations the below code works well
disablingRules: [
{ from: currentdate, to: '<' }, //diable less than today's
date
{ from: [currentYear, 1, 2], to: [currentYear, 1, 31] },
{ from: [currentYear, 2, 2], to: [currentYear, 2, 28] },
{ from: [currentYear, 3, 2], to: [currentYear, 3, 31] },
{ from: [currentYear, 4, 2], to: [currentYear, 4, 30] },
{ from: [currentYear, 5, 2], to: [currentYear, 5, 31] },
{ from: [currentYear, 6, 2], to: [currentYear, 6, 30] },
{ from: [currentYear, 7, 2], to: [currentYear, 7, 31] },
{ from: [currentYear, 8, 2], to: [currentYear, 8, 31] },
{ from: [currentYear, 9, 2], to: [currentYear, 9, 30] },
{ from: [currentYear, 10, 2], to: [currentYear, 10, 31] },
{ from: [currentYear, 11, 2], to: [currentYear, 11, 30] },
{ from: [currentYear, 12, 2], to: '>' },//next year disable
{ from: ['*', '*', '*'], to: ['*', '*', 29] }, // special case of
disabline the date for feb in case of leap year
],
You can populate the current year as a js variable