Javascript examples for Date Operation:Date Calculation
Calculate Date with start date and number of days with javascript
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from w w w . ja v a2s. co m calculateDateFromDays = function(startDate, days) { var nextDate = new Date() nextDate.setDate(new Date(startDate).getDate() + days) return nextDate }; console.log(calculateDateFromDays("10-28-2018", 4)); }); </script> </head> <body> </body> </html>