Question
Coforge
IN
Last activity: 30 Jul 2024 5:54 EDT
How to format date from input=20240726 to output=26-07-2024
I have a requirement to convert Date in format 20240726 to 26-07-2024 . how can we achive this?
Note:
1) input is date type: 20240726 and output 26-07-2024 is also should be in date type after converting.
eg: input property name : TestDate consists value 20240726
i tried to convert using pxFormatDateOnly [@pxFormatDateOnly(.TestDate,"yyyyMMdd","dd/MM/yyyy")]
so by using this the date converted into 26/07/2024 but when i try to save the value to TestDate property again it says that 26/07/2024 is not valid date property since it was string. so after conversion also it should be in date format only.

@pavankillada
A dateonly property cannot have special chars. So you need to convert the property type to text. Else you can display the formatted value on the UI, but backed save as yyyyMMdd