Magento 1.9 – Disable Future Dates in Datepicker

datedatepickermagento-1.9

I am using magento datepicker. i have an array dates which i want to disable that days in the magento datepicked.

for example 08/29/14 is holiday. so i want to make the date as disable so the user cannot select that.

Many Thanks

Best Answer

Assuming that this is a custom module, take a look at Magento calendar: Datepicker issue to disable days before today

Calendar.setup({
    inputField : 'date',
    ifFormat : '%e/%m/%Y',
    button : 'date_from_trig',
    align : 'Bl',
    singleClick : true,
    dateStatusFunc : disabledDate 
});

function disabledDate(date) {
    var today = new Date();
    return ([date1, date2, ..].indexOf(date.getDate()) !== -1) ? true : false;
};

Array#indexOf

Related Topic