subtract-timeframe
Decrement date by timeframe
Install
npm install @strong-roots-capital/subtract-timeframe
Use
import subtractTimeframe from '@strong-roots-capital/subtract-timeframe'
const date = new Date()
console.log(date)
//=>2019-04-15T03:57:54.654Z
console.log(subtractTimeframe('4H', date))
//=>2019-04-14T23:57:54.654Z