在 jsf 中禁用日历 Richfaces 3 中的日期

问题描述

我正在开发一个使用 jsf 1 和 richfaces 3 的应用程序,其中我有一个日历组件来选择日期。 我想为用户提供选择今天和当前日期前 30 天之间的日期范围的可能性。 为此,我在我的解决方案中做了这个:

<script type="text/javascript">
    function displayDaysFunction(day){
       var curDt = new Date();
       curDt.setDate(curDt.getDate()-30);
       var selectDate = document.getElementById("inputDateCalendar");
       if (selectDate != undefined ) var dateSelectedByUser = new date(selectDate);
     if (selectDate == undefined ){
         selectDate = day.date.getDate();
      }
    if(curDate < selectDate) {
      return false;
     }
   return true;
  }
</script>
<rich:calendar isDayEnabled="displayDaysFunction" /> 

当我显示日历时,用户可以选择当前日期之前 30 天以上。我该怎么做才能只建议用户选择当前日期或当前日期之前的 30 天?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)