How can I remove the Back button from default magento calendar from current date only.

How do you disable the prev button when the previous month is less than the current month?

For instance, if the current month is August, then I want to disable the prev month button so that you cannot see the month of July.

enter image description here

I successfully disabled previous dates from the calendar.

js Code :

var calendarSetupObject = {
                                                    inputField  : "options_'.$optionVal->getId().'_date",
                                                    ifFormat    : "%e/%m/%Y",
                                                    showsTime   : "false",
                                                    align       : "Bl",
                                                    singleClick : true,
                                                    disableFunc: function(date){
                                                        var now= new Date();
                                                        if(date.getFullYear()   <   now.getFullYear())  { return true; }
                                                        if(date.getFullYear()   ==  now.getFullYear())  { if(date.getMonth()    <   now.getMonth()) { return true; } }
                                                        if(date.getMonth()      ==  now.getMonth())     { if(date.getDate()     <   now.getDate() + '.$dod.')  { return true; } } 
                                                        if(date.getDay() == 0) {   return true;   } else {    return false; }


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.