Primefaces calendar component show only month and year

后端 未结 12 1878
南笙
南笙 2020-12-14 03:25

primefaces calendar component is getting Date by default. Can I get only month and year without dates.

How to get only month and year

12条回答
  •  时光取名叫无心
    2020-12-14 03:50

    You could use the viewChange event on the p:calendar to capture the click on the next/previous month. Then you could trigger the dateSelect event by clicking the first day of the month.

    JSF:

    
        
    
    

    To hide the pane with days, add the following to the css

    .monthcal .ui-datepicker-calendar {display: none;}
    

提交回复
热议问题