JSPM

time-slots-generator

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 229
  • Score
    100M100P100Q84286F
  • License MIT

a time slot generator with ability to filter out blocked times

Package Exports

  • time-slots-generator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (time-slots-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

time-slots-generator

A time slot generator with ability to filter out blocked times.

Written in ES5 for maximum compatibility.

Usage

var ts=require("time-slots-generator");

ts.getTimeSlots(blockTimes,showTimeAsString,timeInterval)
  • blockTimes

    • Array of start and end times
    • default: []
    • Use when you want some times periods to be removed(in cases where an appointment is already booked)
    // time format
    // 4:30 ==> 4*60+30 = 270
    [
        [270,360], // start and end time
        [70,1200]
    ]    
  • showTimeAsString

    • Boolean
    • default: false
    • returns the output as a map of time and string

    Eg: {270:'4:30'}

  • timeInterval

    • string
    • default: hour
    • splits the time interval based on the string sent, allowed strings are ["tenth","quarter","half","one","two","three","four"]