I want to add 30 days to current date and get in a format.
Im confused to add a 30 to a date and get new.
Its pure JS Solution needed.
Format : June 10, 2017
I want to add 30 days to current date and get in a format.
Im confused to add a 30 to a date and get new.
Its pure JS Solution needed.
Format : June 10, 2017
var date = new Date(); // Now
date.setDate(date.getDate() + 30); // Set now + 30 days as the new date
console.log(date);
Im assuming you are using datejs?
var newDate = Date.today().add(30).days();
try following:
var yourDate = new Date();
var numberOfDaysToAdd = 30;
console.log(yourDate.setDate(yourDate.getDate() + numberOfDaysToAdd));