Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Date Calculation Field

chinckle
Level 1
Level 1
My form contains a field which the end-user selects a date from a popup calendar. With the date selected I would like to add 90 days to it and post it in another field. Does anyone have an idea how to complete this task? Any help would be appreciated.
5 Replies
_SekharN_
Level 5
Level 5
Here is simple FormCalc code which I used in the past. Try with 'change' or 'exit' events of the date that allows user to select.



var givenDate

givenDate = $.rawValue



xfa.form.formname.subformname.Dateafter90.rawValue = Num2Date((givenDate + 90), "MMM DD, YYYY")



Good luck,

SekharN.
chinckle
Level 1
Level 1
Thanks for your help, but I still don't seem to understand how to do this. I have placed this code on my field that the end-user selects the date. And have named this field givenDate. My other field that I want the date + 90 I have named "Dateafter90". If you could provide a little more help I would appreciate it. I am a novice and this is a little over my head.
_SekharN_
Level 5
Level 5
shoot me an email with attaching a copy of your form at meetsekharv@yahoo.com



Thanks,

SekharN.
awooditch
Level 1
Level 1

Is there a way that you can post the solution??

Thanks!

paulk07
Level 6
Level 6

Here's another option.  FormCalc:

if (StartDate.rawValue==null) then

$.rawValue = ""

else

Num2Date(Date2Num(StartDate.formattedValue, DateFmt(2))  + 90, DateFmt(2))

endif