Licence
ISC
Version
1.0.4
Deps
0
Size
141 kB
Vulns
0
Weekly
0
installation
npm install monthdiff
yarn add monthdiff
Usage
const {calcMonth, calclMonthMod} = require('monthdiff')
calcMonth(6,7)("+") // should return 1
calcMonth(3,7)("-") // should return 8
calcMonthMod(6,7) // should return 1
calcMonthMod(3,-7) // should return 8
You can use the output to as setMonth parameter on new Date().setMonth() method