禁用magento日历中的某些天

时间:2012-08-29 12:08:49

标签: magento calendar

我想在magento中使用日历小部件,我的问题是如何禁用某一天?

我称之为:

<script type="text/javascript">
//<![CDATA[
 Calendar.setup({
    inputField : '_dob',
    ifFormat : '%m/%e/%y',
    button : '_dob_trig',
    align : 'Bl',
    singleClick : true
});
//]]>
</script>

如果我想禁用所有星期一,例如,我该怎么做?

另外,如果我想在今天之后的3天之前禁用所有日子,我该怎么做?

1 个答案:

答案 0 :(得分:5)

你可以这样做

Calendar.setup({
    disableFunc: function(date) {
        return date.getDay() === 1; // Sunday is 0, Monday is 1, and so on
    }
});
相关问题