[英]How disable date selection for previous days in RichFaces Calendar?
我會禁用<rich:calendar>
當前日期之前的日期。 我已經在Google上搜索了此信息,但到目前為止,似乎都沒有任何效果。
任何想法如何以一種簡單的方式做到這一點?
到目前為止,這是我的代碼:
<rich:calendar id="since" popup="false" value="#{c.since}" datePattern="dd/MM/yyyy" firstWeekDay="1" showWeeksBar="false" showApplyButton="false" showFooter="false" >
<a4j:ajax event="change" execute="@this" render="_since"/>
</rich:calendar>
如圖中展示 :
<script type="text/javascript">
// <![CDATA[
var curDt = new Date();
disableBeforeToday = function(day) {
return (curDt.getTime() - day.date.getTime() < 0);
}
// ]]>
</script>
…
<rich:calendar dayDisableFunction="disableBeforeToday" …>
請注意,您必須使用<
因為JSF引擎會認為<
是新標記的開始。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.