To calculate date difference between two given dates
function timeDifference(startDate,endDate) { date1 = startDate; date2 = endDate; laterdate = date1.split(“-“); laterY=laterdate; laterM=laterdate; laterD=laterdate; earlierdate = date2.split(“-“); earlierY=earlierdate; earlierM=earlierdate; earlierD=earlierdate; var laterdate = new Date(laterY,laterM,laterD); var earlierdate = new…