Simply:
yourDate.setDate(yourDate.getDate() - daysToSubtract);
More Related Contents:
- How to calculate number of days between two dates?
- Get week of year in JavaScript like in PHP
- How do you display JavaScript datetime in 12 hour AM/PM format?
- Javascript add leading zeroes to date
- JavaScript seconds to time string with format hh:mm:ss
- Get the time difference between two datetimes
- Comparing date part only without comparing time in JavaScript
- Get String in YYYYMMDD format from JS date object?
- new Date() works differently in Chrome and Firefox
- Parse date without timezone javascript
- how to parse a “dd/mm/yyyy” or “dd-mm-yyyy” or “dd-mmm-yyyy” formatted date string using JavaScript or jQuery [duplicate]
- Parsing a string to a date in JavaScript
- new Date() is working in Chrome but not Firefox
- How to parse a time into a Date object from user input in JavaScript?
- ToLocaleDateString() changes in IE11
- How to format a UTC date as a `YYYY-MM-DD hh:mm:ss` string using NodeJS?
- Check if one date is between two dates
- Min/Max of dates in an array?
- Javascript library for human-friendly relative date formatting [closed]
- Moment.js: Date between dates
- how to determine if date is weekend in javascript [closed]
- Calculate Timezone offset only for one particular timezone
- How to split a string at the first `/` (slash) and surround part of it in a “?
- Convert Date from one format to another format in JavaScript
- Format date and Subtract days using Moment.js
- How to get 2 digit year w/ Javascript? [duplicate]
- Javascript JSON Date parse in IE7/IE8 returns NaN
- Javascript Invalid Date Error in Internet Explorer
- Javascript Date Plus 2 Weeks (14 days)
- Making a live clock in javascript