Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Adding days to field

Avatar

Level 2

I'm trying to find a way to have 2 date pickers that work together to show a pay period  based on 1 date selected in a date picker.

1 date picker the user can select a date and the second date picker that auto populates a date that is 14 days after the date selected in date picker 1 

Please and thank you in advance.

Ian.

1 Accepted Solution

Avatar

Correct answer by
Level 2

I found the answer on another post. The original post was answered by Magus069 and for those looking for this answer I'll share below.

The date field which you want it to be readOnly will need to have the following FormCalc script within the calculate event

if (DateTimeField1.rawValue <> null) then

      Num2Date(Date2Num(DateTimeField1.rawValue,"YYYY-MM-DD") + 2, "YYYY-MM-DD")

else

      null

endif

View solution in original post

1 Reply

Avatar

Correct answer by
Level 2

I found the answer on another post. The original post was answered by Magus069 and for those looking for this answer I'll share below.

The date field which you want it to be readOnly will need to have the following FormCalc script within the calculate event

if (DateTimeField1.rawValue <> null) then

      Num2Date(Date2Num(DateTimeField1.rawValue,"YYYY-MM-DD") + 2, "YYYY-MM-DD")

else

      null

endif