Skip to content

harshpatel1408/booking-slot-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Meeting Space Slots Generator

  • Generates slots based on Start Time and End Time withing a day
  • Remove booked time slots from generated slots.

##Installation

npm install slot-generator

Examples

const slot = require('booking-slot-generator')
let startTime = "10:00"
let endTIme = "23:00"
let slotDuration = 60 // in minutes
let minStartTimeDifference = 15 // in minutes
var bookingTimes = [ { StartTime: "10:00", endTime: "14:00" }, 
             		 { StartTime: "16:00", endTime: "18:00" } ]
let booked = ["11:00-13:00", "14:00-15:00"]
// Single start and end time
slot.getSlotsSingle(startTime, endTime , slotDuration , minStartTimeDifference)
 
// Multiple start and end time
slot.getSlotsMultiple(bookingTimes, slotDuration,minStartTimeDifference)

// Identify booked time from single start and end time
slot.indetifyBookedSlotsSingle(startTime, endTime , slotDuration , minStartTimeDifference)

// Identify booked time from Multiple start and end time
slot.indetifyBookedSlotsMultiple(bookingTimes, slotDuration , minStartTimeDifference)

// Remove booked time from single start and end time
slot.removeBookedSlotsSingle(startTime, endTime , slotDuration , minStartTimeDifference)

// Remove booked time from Multiple start and end time
slot.removeBookedSlotsMultiple(bookingTimes, slotDuration , minStartTimeDifference)

About

Generate booking slots from start and end times

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published