When i tried to block an array of individual dates, its not blocking but when i try using some date range i am able to block the dates.
Below mentioned code is working as i am passing blocked_dates.push({ from: [2020, 4-1, 17], to: [2020, 5-1, 17], inverted: true });
@foreach($available_dates_arr as $adate)
available_dates.push({from:new Date(, -1, ), to:new Date(, -1, )});
@endforeach
blocked_dates.push({ from: [2020, 4-1, 17], to: [2020, 5-1, 17], inverted: true });
var $input = $('.datepicker').pickadate({
disable: available_dates,
min: min_date,
selectMonths: true,
selectYears: true,
format: 'dd-mmm-yy'
});
picker = $input.pickadate('picker');
if (blocked_dates && blocked_dates.length) {
picker.set('enable', blocked_dates);
}
But when i pass blocked_dates.push([2020, 4-1, 17, 'inverted']);
its not blocking the dates.
Ref : pickadate.js
Thanks in advance :)
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire