2

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

1 Answer 1

4

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

answered Aug 25, 2014 at 20:14
8
  • 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. Commented Aug 27, 2014 at 20:19
  • Did you try combining both function. if date not > or date not < return true else false Commented Aug 27, 2014 at 20:36
  • i was checking like this dateStatusFunc : disabledDate , pastdays, giving me the err Commented 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? Commented May 2, 2017 at 7:17
  • @PramodKharade ... for Magento 1.x or 2.x? Commented May 2, 2017 at 23:22

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.