As remover os dias
of the primefaces ? / p>
I tried the configuration below, but the days are displayed when the component is re-weighted.
<p:calendar id="dataTeste" pattern="MM/yyyy" />
Here is the rendered component image:
As remover os dias
of the primefaces ? / p>
I tried the configuration below, but the days are displayed when the component is re-weighted.
<p:calendar id="dataTeste" pattern="MM/yyyy" />
Here is the rendered component image:
The Primefaces component does not support this natively.
Options would be:
However, unless the visual question is very much needed, perhaps a simpler solution is the recommended one. Simply use a combo with the possible date range, each item containing mês/ano
. Or two combos, one with month and one with year.
In particular, I do not see any advantage as a user in having to press arrows to move the month forward or backward, as it gives more work if I want to go to a date further.
Old thread, but I'll leave a workaround that uses javascript and CSS to solve this problem ...
NOTE: Tested on Primefaces 5.2 ...
function setData(){
ano = $("#data .ui-datepicker-year").val();
mes = $("#data .ui-datepicker-month").val();
$('#data_input').val(('0' + (++mes)).slice(-2)+'/'+ano);
}
$( "#data .ui-datepicker-month" ).change(function() {
setData();
});
$( "#daa .ui-datepicker-year" ).change(function() {
setData();
});
.ui-datepicker-inline .ui-datepicker-calendar{
display: none;
}
<p:calendar id="data" value="#{bean.data}" mode="inline" navigator="true" pattern="MM/yyyy"/>
Result: