Giter Club home page Giter Club logo

react-monthly-events's Introduction

react-event-calendar Build Status npm version

A monthly calendar view component for React

A Bootstrap 4 based React component to display monthly scheduled events calendar.

Screenshot

Features

  • Monthly calendar view
  • Can display different types of events (events on exact date, time range events)
  • Modern styling and layout (Bootstrap 4)

Installation

npm install react-monthly-events

Demo

Online demo is available! https://react-monthly-events.herokuapp.com/

Working example

You can quickly setup this calendar component on your local machine and see how it works:
lzakrzewski/react-monthly-events-sandbox

Basic usage

import React, { Component } from 'react';
import MonthlyEvents from 'react-monthly-events';

class YourComponent extends Component {
    render() {
        const currentMonth = new Date('2017-01-01');
        const events = [
            { 
                id: 'event-1', 
                start: '2017-01-03 18:00:00', 
                end: '2017-01-03 19:30:00', 
                allDay: false, 
                event: 'Learn ReactJS' 
            },
            { 
                id: 'event-2', 
                start: '2017-01-04 17:01:00',  
                allDay: false, 
                event: 'Go home' 
            },
        ];
        
        return (
            <div className="row">
                <MonthlyEvents
                    currentMonth={ currentMonth }
                    events={ events }
                />
            </div>
        );
    }
}

Props

  • currentMonth indicates a month to display. For example if you want to display the calendar page for February 2017 you need to provide any date between "2017-02-01" and "2017-02-28".
    It can be string, an instance of moment or an instance of Date Object.
  • events is an array of events to display. The component will filter out the all events from not matching months.

Structure of the event objects

name description type required
id an unique identifier for the event string true
start a date when the event starts ISO string true
event a name of the event ISO string true
allDay when it is true the event will be a "bar" on the top of a cell when it is false the event will appear as "dot" boolean true
end a date when the event ends ISO string false
{
    id: 'event-1',
    start: '2017-02-01',
    end: '2017-02-02',
    event: 'Learn ReactJS',
    allDay: false
}

Dependencies

react-monthly-events's People

Contributors

lzakrzewski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.