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

I want to add days to a date

ciber
Registered: Jan 4 2011
Posts: 2
Answered

Hello I have a field that is a date and I have a field that is nummeric.
I want to add these two fields together so that I will have a new date.
 
I think I have tried everything but it does not work.
 
Can anyone help me.
 
Thanks in advance

Kind Regards

Ruud Weber

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Accepted Answer
This is possible via FormCalc for example.
Put this script into the calculate:event of a date field, you use for the calcualted date.

$ = Num2Date(Date2Num(DateField1.formattedValue, "DD.MM.YYYY") + NumericField1, "DD.MM.YYYY")
Attention: The format of your dates may be different to my example "DD.MM.YYYY".
So if you use "MM/DD/YYYY" you have to change the script in that way.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

ciber
Registered: Jan 4 2011
Posts: 2
Thanx a lot it worked perfectly.

Can u help me with the next question?

I have finished my form without any buttons, like email button, print button submit button etc etc.

I distribute the form, but the reciever gets the form with a "submit form" button. This button is located on the right side of the screen NOT on the form but above that.

When u press that button the form will be sent to a wrong emailadres. Is there a way to change this? I think it is somewhere in the default settings and I cannot find where that is.

Kind Regards

Ruud

Kind Regards

Ruud Weber

loriel2602
Registered: Dec 10 2011
Posts: 1
i have 2 fields, startDate and endDate. I couldn´t start on saturday or sunday, but this is done. My problem is when the endDate finish on saturday or sunday, i can´t add days because don´t make it. this is my code:

var terminar = Date2Num(fechaTermino.formattedValue,"DD-MMMM-YYYY","es_MX")
var diaSemana1=Num2Date(terminar ,"E")
var dia1=Num2Date(terminar ,"DD")
var mes1=Num2Date(terminar ,"MMMM")
var año1=Num2Date(terminar ,"YYYY")
if(mes=="march")then
if(dayofWeek=="7" or dayofWeek=="1" or day=="21")then
endDate.rawValue = null;
endDate.rawValue = null;
else
fechaTermino.rawValue=Num2Date(currentDateNum +184,"DD-MMMM-YYYY")
if(dayofWeek=="6")then
fechaTermino.rawValue=Num2Date(terminar +187,"DD-MMMM-YYYY")
endif
endif

example: if i choose march 23, cant be september 23 because is sunday, i want the endDate to be september 24.
Please help me and forgive my languaje