javascript date minus date in days code example
Example 1: javascript today minus 1 day
var d = new Date();
d.setDate(d.getDate()-1);
Example 2: js date minus 18 years
use moment.js
var d = new Date();
d.setDate(d.getDate()-1);
use moment.js