@strong-roots-capital/next-session-generator
v1.0.0
Published
Generator providing start of next session
Downloads
3
Readme
next-session-generator
Generator providing start of next session
Install
npm install @strong-roots-capital/next-session-generator
Use
import nextSessionGenerator from '@strong-roots-capital/next-session-generator'
console.log(new Date().toISOString())
//=>2019-04-26T01:28:35.727Z
const nextSession = nextSessionGenerator('1H', new Date())
console.log(nextSession.next().value)
//=>2019-04-26T02:00:00.000Z
console.log(nextSession.next().value)
//=>2019-04-26T03:00:00.000Z
console.log(nextSession.next().value)
//=>2019-04-26T04:00:00.000Z