Giter Site home page Giter Site logo

react-google-calendar's Introduction

React Google Calendar

React Google Calendar is an implementation of react-big-calendar that pulls events from multiple Google calendars and reformats them for display. It also allows for many kinds of reoccuring events, such as daily, weekly, and monthly.

Demo && Docs

Getting Started

import Calendar from 'react_google_calendar'

const calendar_configuration = {
    api_key: YOUR_GOOGLE_API_KEY,
    calendars: [
      {
        name: 'demo', // whatever you want to name it
        url: '[email protected]' // your calendar URL
      }
    ],
    dailyRecurrence: 700,
    weeklyRecurrence: 500,
    monthlyRecurrence: 20
}

export default class MyApp extends Component {
    constructor(props) {
      super(props)
        this.state = {
          events: []
        }
    }

    render = () =>
      <div>
        <Calendar
          events={this.state.events}
          config={calendar_configuration} />
      </div>
}

Local Development

  • clone the repository git clone https://github.com/crashspringfield/react-google-calendar.git
  • config.js has a demo API for tests. Update config.js with your API key to access your calendar.
  • Download dependencies: npm install
  • Download peer dependencies: npm i array.prototype.flat moment@^2.22.2 react@^16.6.3 react-big-calendar@^0.20.2 react-dom@^16.6.3 webpack
  • Development build with hot reloading: npm start
  • Build for production: npm run build
  • Run tests: npm test

Further setup

  • Get a Google Calendar API key. Simple Calendar has good instructions for setting this up.
  • Create calendars and make them public. Go to https://calendar.google.com/calendar to create a calendar and make it public. You'll need the Calendar ID in your Home component.

Contributing

If there is any bug needing fixing or feature you'd like to see, open an issue. If you're not getting the data back you expect, see below.

Reoccuring event algorithms

Accounting for all the various ways events can reoccur is a huge undertaking and there are many we missed. Right now we support the following:

  • single events
  • daily events (e.g. every day, every n days)
  • weekly events (e.g. every Monday)
  • monthly events by date (e.g. first of the month)
  • monthy events by day (e.g. first Friday)

If you find an edge case that isn't supported, raise an issue, or create a fork and write your own solution.

LICENSE

MIT

react-google-calendar's People

Contributors

matthewboman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-google-calendar's Issues

The first event in a recurring series is not displayed

I've tried this several times and can't get the first event in a recurring series to display.

screenshot737

Using this component:

import React, {Component} from 'react';
import Calendar from 'react_google_calendar';

const calendar_configuration = {
    api_key: 'AIzaSyCAwrclIkIh_GptShODs6AMk0YE2i0xxxx',
    calendars: [
      {
        name: 'Austere Demo',
        url: 'austere.global_klv4cu461jp3trat1m1u92aqhs@group.calendar.google.com' // your calendar URL
      }
    ],
    dailyRecurrence: 700,
    weeklyRecurrence: 500,
    monthlyRecurrence: 20
}

export default class Agenda extends Component {
    constructor(props) {
      super(props)
        this.state = {
          events: []
        }
    }

    render = () =>
      <div>
        <Calendar
          events={this.state.events}
          config={calendar_configuration} 
          />
      </div>
}

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.