// Validation if From date field more than To Date field function ValidateDate(){ if(isFromDateValid == true && isToDateValid == true) { if(sdate>edate) { xfa.host.messageBox("'From Date'"+sdate+" is more than 'To Date'"+edate,"Dates Incompatibility",0,0); data.Body.SDATE.fontColor = "red"; data.Body.EDATE.fontColor = "red"; data.Body.days.rawValue = null; } else { // Logic to calculation of days between given dates var sdate1 = util.scand("yyyy-mm-dd", sdate); var edate1 = util.scand("yyyy-mm-dd", edate); for(var i=0;i<n;i++) { var sDateT = sdate1.getTime(); var sDateD = sdate1.getDay(); var sDateN = sDateT+(24*60*60*1000); if(sdate1>edate1) { break; } i = i+1; sdate1 = new Date(sDateN); } data.Body.days.rawValue = i; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)