有没有办法在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"/>
答案 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>