time-slot-generator
v1.0.1
Published
Written in ES5 for maximum compatibility.
Downloads
4
Readme
time-slot-generator
A time slot generator.
Written in ES5 for maximum compatibility.
Install
npm install time-slot-generator
Usage
var slotGenerator=require("time-slot-generator");
var ts = slotGenerator(startTime, endTime, interval);
console.log(ts);
Full Example
const slotGenerator = require("time-slots-generator");
var ts = slotGenerator("10:30", "21:30", 2);
console.log("Slots are: \n", ts);
o/p:
Slots are:
[
'10:30-11:30', '11:30-12:30',
'12:30-13:30', '13:30-14:30',
'14:30-15:30', '15:30-16:30',
'16:30-17:30', '17:30-18:30',
'18:30-19:30', '19:30-20:30',
'20:30-21:30',
]