protected void encodeDateMetadata(FacesContext context, DatePicker component) throws IOException {
        LazyDateMetadataModel model = (LazyDateMetadataModel) component.getModel();
        Map<String, String> params = context.getExternalContext().getRequestParameterMap();
        String clientId = component.getClientId(context);
        int year = Integer.parseInt(params.get(clientId + "_year"));
        int month = Integer.parseInt(params.get(clientId + "_month")) + 1;

        LocalDate startDate = LocalDate.of(year, month, 1);
        LocalDate endDate = startDate.plusMonths(component.getNumberOfMonths()).minusDays(1);

        model.clear();
        model.loadDateMetadata(startDate, endDate);
        encodeDateMetadataAsJSON(context, component, model);
    }
Initializes the default settings for the DatePicker component based on its pattern and value type.

@param context the FacesContext instance
@param datePicker the DatePicker component to initialize
primefaces/src/main/java/org/primefaces/component/datepicker/DatePickerRenderer.java