突出显示RichFaces日历中的当前周

时间:2014-01-16 02:33:44

标签: jquery jboss richfaces

有没有办法在RichFaces日历中突出显示当前或选定的一周?

<rich:calendar value="#{oc.overtimeDate}" requiredMessage="Date 1 is required."
  id="#{oc.overtimeDateId}" isDayEnabled="isDayEnabled"
  dayStyleClass="getDisabledStyle" datePattern="MM-dd-yyyy"
  required="true" firstWeekDay="0"/>

1 个答案:

答案 0 :(得分:1)

<rich:calendar>@dayClassFunction(请参阅docs

它看起来像这样:

<h:outputStylesheet>
    .highlightWeek {
        color: red;
        background-color: black;
    }
</h:outputStylesheet>
<h:outputScript>
    var currentWeekNumber = … // determine current week number
    chooseDay = function(day) {
        if (day.weekNumber == currentWeekNumber) return 'highlight';
            return '';
        }
</h:outputScript>
<h:form>
    <rich:calendar dayClassFunction="chooseDay" />
</h:form>