Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Add one day (date) to each row instance

Avatar

Level 1

I'm trying to do the following with formCalc, but javascript will do as well.  I have a travel expense form with a travel start and end date field.  The difference in days sets the instances of an expense table. I'm trying to get the first row = to the start date; for each subsequent row, I'm trying to add a day to each row.  I've declared a variable to formate the date to a number (var startDate2Num = Date2Num(sf_Header.tbl_Header.Row3.dtd_Start,"YYYY-MM-DD")).  That works; however, I cannot add 1 to each subsequent instance. 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@walkerb3 

You can try this: Num2Date(Date2Num(sf_Header.tbl_Header.Row3.dtd_Start,"YYYY-MM-DD") + 1)

And a similar example available here:

https://experienceleaguecommunities.adobe.com/t5/adobe-livecycle-questions/adding-days-to-a-date/qaq...

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

@walkerb3 

You can try this: Num2Date(Date2Num(sf_Header.tbl_Header.Row3.dtd_Start,"YYYY-MM-DD") + 1)

And a similar example available here:

https://experienceleaguecommunities.adobe.com/t5/adobe-livecycle-questions/adding-days-to-a-date/qaq...