I am working on JSF with primefaces, i have a calendar field in those when i need to disable some dates , so i have used the attribute named beforeShowDay
, but the thing is that when i use this attribute the calendar is not opening(not pop-up) , but when i dont use beforeShowDay
attribute it is working ,
My code is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <!--namespaces-->>
<h:body>
<ui:composition>
<ui:define name="content">
<script type="text/javascript">
function tuesdaysAndFridaysDisabled(date)
{
var day = date.getDay();
return [(day != 2 && day != 5), '']
}
</script>
<h:form>
<p:calendar id="leavefrom" value="#{requestbean.leavefrom}" beforeShowDay="tuesdaysAndFridaysDisabled" effect="drop" pattern="yyyy/dd/MM" required="true" >
<p:ajax update="leaveto" event="dateSelect" />
</p:calendar>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
Any suggestion for this..