How to assign the earliest date among 4 given dates?
I have 4 solutions with different expiry dates and I need to assign the earliest expiry date among the 4 for the final product. I am using Acrobat Pro and any help is greatly appreciated. Thanks!
I have 4 solutions with different expiry dates and I need to assign the earliest expiry date among the 4 for the final product. I am using Acrobat Pro and any help is greatly appreciated. Thanks!
The dates array is for the values. If you want to hard-code the field names then use this:
var dateFormat = "mm/dd/yyyy";
var fields = ["801080EXP","801016EXP","801017EXP","801018EXP"];
var dates = [];
for (var i in fields) {
var f = this.getField(fields);
var v = f.valueAsString;
if (v!="") dates.push(util.scand(dateFormat, v));
}
if (dates.length==0) event.value = "";
else {
dates.sort(function(a, b){return a.getTime() - b.getTime()});
event.value = util.printd(dateFormat, dates[0]);
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.