突出显示RichFaces日历中的当前周 [英] Highlight current week in RichFaces calendar

查看:81
本文介绍了突出显示RichFaces日历中的当前周的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Is there a way to highlight the current or selected week in a RichFaces calendar?

<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"/>


推荐答案

< 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>

这篇关于突出显示RichFaces日历中的当前周的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆