Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Need Help with Date

Avatar

Level 2

I have never been able to get this issue to work satisfactory.  Any help would be great.  I need a date field in the MM/DD/YYYY format that will automatically fill our and enter the slashes when the user enters information.  For instance if they enter 6291978 the script will automatically enter it as 06/29/1978.   I need it to read and enter any leading zeros and to automatically enter the slashes.  thanks in advance.

3 Replies

Avatar

Level 10

In the properties of the Date Field select the patterns and place the below text..

Display Pattern: date{MM/DD/YYYY}

Edit Pattern: date{MMDDYYYY}

If the entered value does not match the Edit pattern, the field does not translate to the Display pattern.

Thanks

Srini

Avatar

Level 2

that seems to be a more helpful way to do things.  However, I am still at a loss if they do not enter the beginning zeros for dates...such as for 5/5/1970...if they do not enter 05/05/1970 it will not format it correctly.  Thank you for taking the time.

Avatar

Level 10

Just change the Edit Pattern little bit.. This can help.

     Edit Pattern: date{M/D/YYYY}

Thanks

Srini