Get day certain days ago - Node.js Date

Node.js examples for Date:Day

Description

Get day certain days ago

Demo Code


define(function () {
  Number.prototype.daysAgo = function () {
    var d = new Date
    d.setDate(d.getDate() - this)/*from w  w w. ja  v a2 s.co  m*/
    return d
  }
})

Related Tutorials