Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Problem calculating difference between dates

Avatar

Level 7

I have two date fields Current date and Hire date. I also have a difference field.

The Current date is calculated and is displayed as 3/16/2011.

However, the hire date is displayed as 03/01/2011. Nothing is displayed in the difference field. However, if I remove the leading zero from the Hire date field, I get the correct difference.

How do I control the leading zero in one or the other date field?

Thanks,

MDawn

3 Replies

Avatar

Level 10

Hi,

the look of a date can be controlled by a pattern.

date{M/D/YYYY} = 6/2/2011

date{MM/DD/YYYY}  = 06/02/2011

Avatar

Level 7

I'll try that.

Thanks,

Margaret Dawn

630-850-1065

Avatar

Level 7

The pattern worked to control the leading zero. Now I've discovered that the calculation works if I type the date directly in the field, but doesn't work if the date is

selected from the calendar icon.

Thanks,

MDawn