Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Date Time control changes format after property recalculation

SA-21950

Summary



A pxDateTime control is configured to display using read only formatting only the date portion dd.mm.yyyy of a DateTime property, where the value is calculated using a declare expression.

This works initially but the format switches to a different one including the time when the section is reloaded.




Error Messages



Not Applicable


Steps to Reproduce



Configure a date time property with a value set to a declare expression to display as read only.


Root Cause



Date time custom formats and Date formats are not supported as read only for use through declare expressions.

Resolution



Perform the following local-change:
  1. Create a new Text property to contain the string value of the date.
  2. Define a new declare expression to populate this string based on the date or time property.

For example here the value of DateTime1_Text property is set to be the date from DateTime1, which is formatted to dd.MM.yyyy



At runtime, one can see that the Text value retains the formatting.


Published April 3, 2017 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice