How to convert and show the date format (mm/dd/yyyy) of date/datetime property on change of a Calendar control from UI screen?
We have a requirement to convert and show the date format in mm/dd/yyyy after doing all the date validations using a Date/DateTime property. That too we need to show this format from a calendar control after tab out or change of Calendar control from a user input perspective. I know there is no direct OOTB feature for it. We would like to fulfill this requirement using server side and not Client side. As there are some forceful validations for Date/DateTime properties, we are unable to achieve this as per our requirement.
What we are thinking is like create a text property for each date field on UI to validate & show the value in mm/dd/yyyy. After successful conversion of all the fields on the screen, we do property-set to map these text properties to actual Date/datetime properties to store in DB. For these new text properties, we are storing them in BLOB and not extract them using BIX. These properties are just for UI level display purpose only.
I know this approach is not that good approach but I would like the experts to get any other thoughts to achieve this requirement using server side only. Appreciate your help in this regards.
Thanks for the suggestion. This was already tried but didn't work for the user who enters "12112017" in the Calendar control and giving invalid date err like "TestDate1:12112017 is not a valid date value". After that nothing works for me and no conversion of date format. But my intention is to display the date value on UI is like "12/11/2017" after tab out from Calendar control. As this property is DateTime property, system is validating the input date internally and stopping us to proceed further. If user gives direct "mm/dd/yyyy" then no issues. But we can't ask user to give like that. User can enter anything and we need to convert it to mm/dd/yyyy after all validations done. Hope this helps you.