I have 3 domains. A field is a constant date mm/dd/yy. The second field is a digital number (1-120) and can be changed. The third field calculates two fields 1 and 2 in the summation and shown in mm/dd/yy. How do I calculate that in the script?

How do I calculate that in the script? I have 3 domains. A field is a constant date mm/dd/yy. The second field is a digital number (1-120) and can be changed. The third field calculates two fields 1 and 2 in the summation and shown in mm/dd/yy.

You searched for ' add days?

You must write a custom for this JavaScript calculation because you cannot add a number any date. Also the date strings are not just a number, even if we can convert a given date in a number for that date that represents the time form a date date (Epoch). Witn this value, we can achieve them all kinds of date calculations and collect a little information about the date. JavaScirpt uses midnight on January 1, 1970 UTC for starting point or the date of the time. Its value is zero, and every millisecond increases the value of 1. When a date string is converted to the date object JavaScirpt we have access to many properties of the date and can use several methods to extract information or adjust the date object.

Field 1 is in the format "Date" with a format of "mm/dd/yy".

Field 2 is in «Number» format with 0 decimal.

Zone 3 is in the format 'None '. The custom calculation script applies to the formatting.

The custom for JavaScript calculation area 3:

var cField1 = this.getField("Field_1").valueAsString;

var cField2 = this.getField("Field_2").valueAsString;

Event.Value = "";

If (cField1! = "" & cField2!) = "") {}

Console.println (cField1 + "" + cField2);

calculate that if we as no null data;

var cDateFormat = "mm/dd/yy";

convert start date date object.

Kai var = util.scand (cDateFormat, cField1);

get the date of the month;

David var = oDate.getDate ();

Add field 2 number of days;

David = Number (nDate) + Number (cField2);

of being updated for the new date.

oDate.setDate (nDate);

Set the field to update formatting;

Event.Value = util.printd (cDateFormat, letter);

} / / end of data not null;

Tags: Acrobat

Similar Questions

Maybe you are looking for