Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

Can someone help? Add date to date field.

Avatar

Level 3

I'm trying to make a form so a Starting Day & Date is selected and the following x number of fields are populated with x number days & dates. Example, if Wednesday August 17th 2011 is selected from a date field the field below it will display Thursday August 18th 2011 and the field below that Friday August 19th 2011 and so on.

I have searched for hours and have found many discussions on this but nothing i under stand or make work. I know little to nothing about this program.

I have created a Date/Time Field 1 which displays the current date and the following fields are populated with the following dates. However, this is based off the current date. If the fields were labeled Monday - Friday, Monday being the starting date and it was opened on a Tuesday the Monday date would be wrong therefore making the rest of the days & dates wrong.

Is this really that hard? It doesn't seem that hard but me knowing nothing doesn't help.

Thanks!

2 Replies

Avatar

Level 6

Here's a possible solution.  Your first field is where you select the date.

In the next field:

if (StartDate.rawValue==null) then
$.rawValue = ""
else
Num2Date(Date2Num(StartDate.formattedValue, DateFmt(2))  + 1, DateFmt(2))
endif

the next field:

if (StartDate.rawValue==null) then
$.rawValue = ""
else
Num2Date(Date2Num(StartDate.formattedValue, DateFmt(2))  + 3, DateFmt(2))
endif

the next field:

if (StartDate.rawValue==null) then
$.rawValue = ""
else
Num2Date(Date2Num(StartDate.formattedValue, DateFmt(2))  + 4, DateFmt(2))
endif

and so on.

Not pretty but it works.  I can send you the sample if you'd like

Avatar

Level 3

I got that to work once I changed the start date field name to StartDate and put the code in the calculate area, I put it in the validate area first.

Thank you!