1.0.1 • Published 3 years ago

time-slot-generator v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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', 
]