These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Calculate Dates

koenigma
Registered: Jan 23 2008
Posts: 45

I created an expense report form which povides space for up to 14 days, with 2 calendars to indicate the period covered`(e.g. Starting Date % Ending Date).

What I would like to do, is that based upon the Start & End Date, the individual dates are entered at the top of each column.

Any help would be appricated.
Martin

My Product Information:
Acrobat Pro 8.1.4, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You can create a text field with a FormCalc script in it's calculate event.
The script will look, what date is given in another field (for example you start date) and calculates a new date.

This example will calculate a date 14 days after the start date.

if (StartDate.rawValue==null) then$.rawValue = ""elseNum2Date(Date2Num(StartDate.formattedValue, DateFmt(2))  + 14, DateFmt(2))endif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

pforms
Registered: Nov 17 2009
Posts: 87
I have a 14 day sample (assuming in your case it is always 14 days):

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

Date Field followed by 13 text fields
In each of the 13 text fields paste the above FormCalc but change only the (+) "number" (you need 1 through 14)
No need for a second date field