Calculating Dates
i need calculate new date based off date , exclude weekends.
for example have field called "date position closed". if enter date of 5/20/2016 should populate field called "target date qrb" 9/27/2016. 90 business days after initial date.
so far have, calculates based off calendar days:
var strstart = this.getfield("datepositionclosed").value;
if(strstart.length)
{
var datepositionclosed = util.scand("m/dd/yyyy",strstart);
var oneday = 24 * 60 * 60 * 1000;
var duemillis = datepositionclosed.gettime() + 130 * oneday;
var duedate = new date(duemillis);
event.value = util.printd("m/dd/yyyy",duedate);
}
else
event.value = "na";
do have account holidays or feast days?
if so makes script far more complicated since these special days might not fixed year year.
More discussions in JavaScript
adobe
Comments
Post a Comment