0.0.8 • Published 5 years ago

booking-slot-generator v0.0.8

Weekly downloads
86
License
ISC
Repository
github
Last release
5 years ago

Functionality

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

##Installation

npm i booking-slot-generator

Examples

var bookingSlotGenerator = require("booking-slot-generator")
var startTime = "10:00" // it should be in 24 hours format (dataType = STRING)
var endTime = "23:00" // it should be in 24 hours format (dataType = STRING)
var slotDuration = 60 // in minutes (dataType = integer)
var minStartTimeDifference = 15 // in minutes (dataType = integer)
var bookingTimes = [ { StartTime: "10:00", endTime: "14:00" }, 
                     { StartTime: "16:00", endTime: "18:00" } ] // (dataType = Array)
var booked = ["11:00-13:00", "14:00-15:00"] // (dataType = Array)
// Single start and end time
bookingSlotGenerator.getSlotsSingle(startTime, endTime , slotDuration , minStartTimeDifference)
 
// Multiple start and end time
bookingSlotGenerator.getSlotsMultiple(bookingTimes, slotDuration,minStartTimeDifference)

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

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

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

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

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago