primefaces calendar component is getting Date by default. Can I get only month and year without dates.
How to get only month and year
You could do in this way:
XHTML
CSS
.ui-datepicker-calendar {
display: none;
}
BEAN
public void onChangeDataInicio(DateViewChangeEvent event) throws ParseException {
dataInicio = new Date();
SimpleDateFormat dateformat = new SimpleDateFormat("dd-M-yyyy");
String inicio = "01-"+event.getMonth() +"-" + event.getYear();
this.dataInicio = dateformat.parse(inicio);
}
It worked to me!