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
asked Aug 25, 2014 at 19:19
Pradeep Sanku
9,2662 gold badges42 silver badges75 bronze badges
1 Answer 1
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;
};
answered Aug 25, 2014 at 20:14
MagePal Extensions
14k2 gold badges34 silver badges52 bronze badges
-
i have 2 function one above disabling future dates and one disabling the past days.how can i call this 2 functions at a time.Pradeep Sanku– Pradeep Sanku2014年08月27日 20:19:09 +00:00Commented Aug 27, 2014 at 20:19
-
Did you try combining both function. if date not > or date not < return true else falseMagePal Extensions– MagePal Extensions2014年08月27日 20:36:07 +00:00Commented Aug 27, 2014 at 20:36
-
i was checking like this dateStatusFunc : disabledDate , pastdays, giving me the errPradeep Sanku– Pradeep Sanku2014年08月28日 03:35:29 +00:00Commented Aug 28, 2014 at 3:35
-
where this code will going to place? I have scenario for purchase order date. I want to disable past date disable in magento 2. what i have to do?Pramod Kharade– Pramod Kharade2017年05月02日 07:17:36 +00:00Commented May 2, 2017 at 7:17
-
@PramodKharade ... for Magento 1.x or 2.x?MagePal Extensions– MagePal Extensions2017年05月02日 23:22:50 +00:00Commented May 2, 2017 at 23:22
default