Question

How to convert and show the date format (mm/dd/yyyy) of date/datetime property on change of a Calendar control from UI screen?

Hi,

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,

Ravi Kumar Pisupati

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

September 8, 2017 - 5:35pm

If you are using V7 the below steps will work for you.

1. Create a Date Time property.

2. In UI select the Date Time control.

3. In Presentation tab, Select Editable settings Date/Time as Date.

4. Read Only format: Type as Date and Date Format select as "10/01/2001"

In UI, you can see in mm/dd/yyyy format.  This will solve your UI issue. Also, you can validate on the same date time property.

 

 

 

September 8, 2017 - 6:49pm
Response to Jakeer

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.

Thanks,

Ravi Kumar.

September 13, 2017 - 9:28pm

We are proceeding with the mentioned approach due to no time for us to think other options.

Thanks,

Ravi Kumar.