Javascript 如何禁用richfaces 3中的某些日期

Javascript 如何禁用richfaces 3中的某些日期,javascript,jquery,jsf,richfaces,facelets,Javascript,Jquery,Jsf,Richfaces,Facelets,我使用richfaces 3的rich:calendar组件,我希望在日历中显示当前日期前30天,并禁用所有大于当前日期前30天和当前日期前30天的日期。 我这样做 <script type="text/javascript"> var curDt = new Date(); function disablementFunction(day){ if (curDt==undefined){ curDt = day.d

我使用richfaces 3的rich:calendar组件,我希望在日历中显示当前日期前30天,并禁用所有大于当前日期前30天和当前日期前30天的日期。 我这样做

<script type="text/javascript">
    var curDt = new Date();
    function disablementFunction(day){
       if (curDt==undefined){
         curDt = day.date.getDate;
      }
   if (curDt.getTime() - day.date.getTime() <= 2592000) return true; else return false;
  }
</script>
<rich:calendar isDayEnabled="disablementFunction" />

var curDt=新日期();
功能禁用功能(天){
如果(curDt==未定义){
curDt=day.date.getDate;
}

如果(curDt.getTime()-day.date.getTime()“不起作用”没有告诉我们任何事情,那就是说
date.getTime()
以毫秒为单位返回时间,因此我认为您的公式不正确Hello@Makhiel,它不起作用意味着我的rich:calendar不符合我的要求。我希望我的rich:calendar在今天之前30天禁用,在今天之后所有日期都禁用。您观察到了什么行为?它是否禁用了无日期,是否禁用了错误的日期?您检查过了吗该方法正在被执行?