I tried editing PrimeFaces locale message but the changes is not reflecting. I already check the widget of calendar in web console and the changes is already there. But still it uses the default message.

Calendar_en_US.js

PrimeFaces.locales['en_US'] = {
                //other stuff
                messages : {
                    ..
                    'javax.faces.converter.DateTimeConverter.DATE_detail':'[E-WAR-0037][E-WAR-0037] {2}: \'{0}\' could not be understood as a date. Example: {1}',
                    ..
            };

and attached to page by

    <h:outputScript library="js" name="${request.contextPath}/resources/js/calendar_en_US.js" />

and used it to calendar

    <p:calendar widgetVar="issueDateVar" id="issueDate" pattern="yyyy-MM-dd"  size="14" showOn="button"  locale="en_US"
                            navigator="true" styleClass="#{maintainUi.requiredStyleClass}" onblur="transformVal(this);"
                            value="#{maintainUi.obj.IssueDate}"
                            disabled="#{maintainUi.readOnly}"/

The message error is still

Warrant Issue Date: '999' could not be understood as a date. Example: 2019-04-17

it Should be

[E-WAR-0037]Warrant Issue Date: '999' could not be understood as a date. Example: 2019-04-17

1 Answers

0
Community On Best Solutions

Starting from JSF 1.2, use the converterMessage attribute to replace the entire message.

I found my solution here

Custom Variables in JSF Converter's Error Message