var date = new Date();
date.setDate(date.getDate() + 7);
console.log(date);
And yes, this also works if date.getDate() + 7
is greater than the last day of the month. See MDN for more information.
More Related Contents:
- How to add number of days to today’s date? [duplicate]
- jQuery UI DatePicker to show month year only
- how to parse a “dd/mm/yyyy” or “dd-mm-yyyy” or “dd-mmm-yyyy” formatted date string using JavaScript or jQuery [duplicate]
- Get first and last date of current month with JavaScript or jQuery [duplicate]
- How do I pre-populate a jQuery Datepicker textbox with today’s date?
- How to add/subtract dates with JavaScript?
- Get week of the month
- Convert normal date to unix timestamp
- How to get the hours difference between two date objects? [duplicate]
- Set date in input type date
- How to split a string at the first `/` (slash) and surround part of it in a “?
- Get current date in DD-Mon-YYY format in JavaScript/Jquery
- JavaScript Detecting Valid Dates
- Find all the days in a month with Date object?
- Check if date is in the past Javascript
- Get age from Birthdate [duplicate]
- How to check if a string is a legal “dd/mm/yyyy” date?
- Convert iso timestamp to date format with Javascript?
- moment.js isValid function not working properly
- Sort Array Elements (string with numbers), natural sort
- How to do a Jquery Callback after form submit?
- Limit number of lines in textarea and Display line count using jQuery
- How to auto-scroll to end of div when data is added? [duplicate]
- Bootstrap datepicker disabling past dates without current date
- jQuery scrolltop firefox not working
- Value was evaluated just now with console.log on JavaScript object
- Disable elastic scrolling in Safari [duplicate]
- Wrap Text In JavaScript
- How to iterate a table rows with JQuery and access some cell values?
- How can I compare two color values in jQuery/JavaScript?