Giter Club home page Giter Club logo

scheduler-calendar's Introduction

scheduler-calendar

Scheduler Calendar Component for React Js

NPM JavaScript Style Guide

Installation

npm install --save scheduler-calendar

Usage

import React, { Component } from 'react'

import SchedulerCalendar from 'scheduler-calendar'
import 'scheduler-calendar/dist/index.css'

class Example extends Component {
  render() {
    return (
      <SchedulerCalendar
              availabilities={[
                {
                  day: "mon",
                  slots: [
                    {from: '09:00', to: '10:30'},
                    {from: '11:30', to: '13:00'},
                    {from: '14:30', to: '17:00'},
                  ]
                },
                {
                  day: "2021-01-26",
                  slots: [
                    {from: '09:00', to: '10:30'},
                    {from: '11:30', to: '19:00'},
                  ]
                },
              ]}
              availabilityType={'infinity'}
              duration={10}
              onIntervalChange={() => {}}
            />
    )
  }
}

SchedulerCalendar Props

Prop Type Description
availabilities Array List of availabilities. Eg. [{day: "mon", "slots": [{from: "11:00", to: "13:00"}]}]
duration number Minimum duration of time interval
onIntervalChange Function Callback when a interval is updated and it's contains the array of updated values
availabilityType string values must be one of rolling (for number of days) or range or infinity
availabilityEndDate Moment end of date range when availability type is 'range'
availabilityStartDate Moment start of date range when availability type is 'range'
availabilityRolling number number of rolling days when availability type is 'rolling'
initialRenderOfRows number Optional. number of rows to render at initial
totalNumOfRows number Optional. total number of rows for calendar
tableContainerStyle string Optional. to style calendar
dayContainerStyle string Optional. to style each cell of calendar
dayTextStyle string Optional. to style day text
intervalsWrapStyle string Optional. to style wrapper of interval shown in calendar
is24hour boolean Optional. true if time in 24 hours
topHeaderStyle string Optional. to style header container
isBusinessDays boolean Optional. to avoid sundays and saturdays in rolling days
isDisabledDateLocked boolean Optional. to turn off changing the availability for past date
stylesOfDay Function Optional. Callback with 3 parameters ( day: Date, isAvailable: Boolean, isRolling: Boolean ) for conditional styling
intervalStyles Object Optional. To style each intervals inside a cell
customHeaderComponent Function Function to return custom header
inputRef any Ref object

Screenshots

Screenshot 2021-03-15 at 7 05 15 PM

Screenshot 2021-03-15 at 7 05 25 PM

Screenshot 2021-03-15 at 7 05 38 PM

Authors

License

MIT © Stead

scheduler-calendar's People

Contributors

ashique-kv avatar ayarshabeer avatar azadhmhd avatar mishhub avatar shabeerayar avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.