GetDateDiff(flddtval) { // functions compares today w/passed date and returns the number of days between them if (flddtval == undefined || flddtval =='') { // nothing passed return null; } nowdt = new Date(); // today flddt = new Date(flddtval); // field date, format must be integer since 1/1/70, date string, or comma delitated numbers if (flddt == null) { // no date created, bad value passed into function return null; } // get difference dtdiff = flddt - nowdt; // convert to days daysstr = new String(dtdiff/1000/60/60/24); // 1000 ms / 60 secs / 60 mins/ 24 hrs daysno = parseInt(daysstr); return daysno; }