Setting primefaces calendar end date after setting start date

后端 未结 1 445
夕颜
夕颜 2021-01-27 23:59

I\'m using primefaces calendar for the creation of an event. With the \"mindate\" parameter i have disabled the days before the current day. I want to do this even with the end

相关标签:
1条回答
  • 2021-01-28 00:16

    You can use <p:ajax> to update the end date on select of start date. The <p:calendar> supports the ajax event dateSelect which is fired when a date is selected.

    So, this should do:

    <p:calendar value="#{bean.startDate}" mindate="#{bean.today}">
        <p:ajax event="dateSelect" update="endDate" />
    </p:calendar>
    <p:calendar id="endDate" value="#{bean.endDate}" mindate="#{bean.startDate}" />
    
    0 讨论(0)
提交回复
热议问题