Question
Cognizant
NL
Last activity: 12 Jan 2017 18:59 EST
How to give Custom date format in HTML
I am trying to send grid in through correspondence, in which one of the property is of date type. How to place custom date format for that property in HTML?
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
Hi Venkata,
Assuming you are creating the correspondence as a rule in Pega Platform, you shouldn't have to specify the format in the HTML. Using the WYSIWYG editor, reference the date property and specify it's format in the property panel that displays.
Or if it's a dynamic repeat grid, create it in a section, specify the date format in the date control parameters, and then include the section in your correspondence rule.
Thanks.
B.
Updated: 24 Aug 2015 16:10 EDT
Cognizant
NL
Sorry Brendan, I didnt get you. But I have taken a custom control and in its HTML tab I have taken the same HTML as of Date-Medium-i18n and modified date format as "dd MMM YYYY"(this date format not provided by Pega like 01 Sep 2015). It is working fine but failing for y2k years, like 2000,2100,2200 etc., i am getting 2001,2101 etc in my correspondence and UI as well. Is there any way to solve this?
Thanks.
V.
Pegasystems Inc.
US
I see so you are trying to use a date format not provided out of the box?
I will need to reach out and find someone who might have a better answer than I can give. I am more familiar with working with the auto-generated controls than I am custom ones.
I'll start the outreach right here... Is there anyone in the community who has suggestions for Venkata?
Thanks.
B.
-
Gajanan Golkonda
Pegasystems Inc.
US
Hi Venkata,
What release are you using?
Does this Pega 7.1.5 Release Note help?
https://community.pega.com/support/support-articles/ie-freezes-when-printing-pega-image-viewer
(https://community.pega.com/knowledgebase/release-note/format-options-datetime-control)
-Mary
Cognizant
NL
Hi Mary,
I am using Pega 7.1.8.
I need to display the date in correspondence and format is 01 Sep 2015. In Pega this format is not present. So I have taken custom control to define that.
How could I give custom date format in HTML in Pega, that should convert the timeZone accordingly and should work for both date time, date inputs?
Thanks
V.
Pegasystems Inc.
US
In the documentation Mary provided, there is a "Custom" option for date-time format in pxDateTime. The last time I used this (in 7.1.5) it took standard Java date formats. So to display "01 Sep 2015" you would use the string "d MMM yyyy"
-
Sahana Avijit
Centene Corporation
US
When we use custom option, it is displaying user time zone. can we display other time zones using this control ??
Cognizant
IN
BNZ
NZ
I am still facing issue when I try to format and display a DateTime Property in the format "DD/MM/YYYY" as read-only.
When I try to apply Custom format on the DateTime property, it does not work and gets formatted always to the format 20170111T031342.080 GMT.
Even if I try to convert the Type to Date instead of DateTime, I am getting the same issue.
BNZ
NZ
There are two additional things that I have noticed to be considered while troubleshooting issues around date formatting to custom format.
1. Within Cell Properties-> Label->Use property default (Uncheck this). Having this checked is not applying the Date-Format choosen in the Presentation Tab
2. There is another know issue with formatting the Date Time control while using it in combination with a Declare Expression. Please refer the below link