primefaces calendar component is getting Date by default. Can I get only month and year without dates.
How to get only month and year
The last release of Primefaces (Version 7.0) has just added what you need: the
.
It works almost exactly as a
but it can be easily configured to show only months and years:
For example, when a month is selected, its value is stored in a "Date" object, which will have the value:
(If April of 2019 is selected) Mon Apr 01 00:00:00 BRT 2019
In this case, you would just have to ignore the day, hour, minute, etc values and use the month and year selected.
For more information, read the Documentation and see the Showcase