Issue with pega:reference tags with custom datetime format
SummaryCustom datetime format is defined using a custom Control, for example, your_CustomDTFormat as yyyy-MM-dd'T'HH:mm:ss.
Using this custom datetime format with pega:reference tags for a non-autogenerated Section does not work correctly.
Including code like this:
<pega:reference name="$this.your_Date" format="your_CustomDTFormat" ></pega:reference>
Results in date output that looks like this: "Apr 19, 2017 08:44:33 AM"
This works correctly for an auto-generated HTML Section. In that case, the date output looks like this:
Error MessagesNot Applicable
Steps to Reproduce1. Create a custom Control and define the custom format.
2. Use the new Control inside a non-autogenerated HTML of a Section Rule to display DateTime property in read-only mode.
Root CauseThis is working as expected. Since the control is autogenerated, when referred inside an autogenerated section, it is markup is generated correctly (check the actions->view Java or at runtime inspect the element to find markup at runtime).
In the non-autogenerated section, user is referring to it in a Pega reference tag which will not generate the same markup.
ResolutionPerform the following local-change:
Pega's FormatDateTime Function of DateTime library supports java dateformat patterns and "yyyy-MM-dd'T'HH:mm:ss.SSSZ" is one of the java dateformat patterns.
So it is possible to get the value in these formats without using custom Controls inside a non-autogenerated HTML Section.
Published April 25, 2017 - Updated May 19, 2017