Support Article
Date format changes after Validation Message
SA-106934
Summary
On selecting a future date, the value displays in the DD/MM/YYYY format. However, IsPastDate client validation displays an error message and the format changes to MM/DD/YYYY.
Error Messages
Not Applicable
Steps to Reproduce
Select a future date.
Root Cause
This behavior is as per Pega product design.
Resolution
Here’s the explanation for the reported behavior:
The Date format is dependent on the Locale settings. The Locale settings are derived from the system where the user is accessing the settings or is based on the Locale settings in the Operator ID. The Locale setting in the Operator ID always takes precedence.
For example,
If the locale is set as en_IN in the Operator record, then the format is DD/mm/yyyy and MM/dd/yyyy for en_US.
Similarly, the Date formats change according to the locale specified in the operator record. Different Date formats can be specified in the Date control in the Presentation tab. However, these styles are applicable only when the Date is in the read-only mode (that is, the date is valid or the focus is not on the Date field).
If the date is invalid according to the Validation logic, the error displays on the Date field in the UI and the Date field changes to the Editable mode. The read-only formats are not applicable in the Editable mode.
Published April 18, 2020 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.