npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-monthly-events

v0.0.7

Published

The react js component to display calendar with events in given month.

Downloads

3

Readme

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