gpt4 book ai didi

magento - 在 magento 日历中禁用某些日子

转载 作者:行者123 更新时间:2023-12-02 22:31:30 25 4
gpt4 key购买 nike

我想在 magento 中使用日历小部件,我的问题是我怎样才能禁用某一天?

我是这样调用它的:

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

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

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

最佳答案

你可以这样做

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

关于magento - 在 magento 日历中禁用某些日子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12177566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com