Date input: MM/DD/YYYY format. Function will return date difference in Days.
Inputs:
DateStart: 08/10/2021
DateEnd: 08/11/2021
Result:
DaysCount: 2
var DaysCount, DateStart, DateEnd;
DaysCount = getDateDiff(DateStart, DateEnd);
-- -- -- getDateDiff -- -- --
function getDateDiff(DateStart, DateEnd)
{
DateEnd = new Date(DateEnd);
DateStart = new Date(DateStart);
var diffDays = (DateEnd - DateStart)/(1000*60*60*24);
diffDays = ToNumber(diffDays)+1;
return(diffDays)
}
Comments
Post a Comment