Giter Site home page Giter Site logo

marcoslimacom / add-to-calendar-buttons Goto Github PK

View Code? Open in Web Editor NEW

This project forked from carlsednaoui/add-to-calendar-buttons

0.0 0.0 0.0 581 KB

Easily add a "add to calendar" button to your websites. This JavaScript library supports Google Calendar, iCal, Outlook and Yahoo Calendar.

HTML 21.76% CSS 6.91% JavaScript 71.33%

add-to-calendar-buttons's Introduction

OuiCal

A simple JS library that enables you to add an "add to calendar" button for your upcoming events.

Inspiration

This project was inspired by Eventbrite's add to calendar feature (which should have been open sourced #justSayin).

How to use it?

Call 'createCalendar' with your event info, pass in any optional parameters such as a class and/ or id and boom! Insert your add-to-calendar div wherever you'd like.

The only fields that are mandatory are:

  • Event title
  • Start time
  • Event duration, in minutes

Example

var myCalendar = createCalendar({
  options: {
    class: 'my-class',
    
    // You can pass an ID. If you don't, one will be generated for you
    id: 'my-id'
  },
  data: {
    // Event title
    title: 'Get on the front page of HN',

    // Event start date
    start: new Date('June 15, 2013 19:00'),
    
    // Event duration (IN MINUTES)
    duration: 120,

    // You can also choose to set an end time
    // If an end time is set, this will take precedence over duration
    end: new Date('June 15, 2013 23:00'),     

    // Event Address
    address: 'The internet',

    // Event Description
    description: 'Get on the front page of HN, then prepare for world domination.'
  }
});

document.querySelector('#place-where-I-want-this-calendar').appendChild(myCalendar);

Here is a live example

Looking for Instant Gratification?

Copy OuiCal into Chrome's JS console (or whatever browser you're using).

Then call this:

document.getElementsByTagName('body')[0].appendChild(createCalendar({data:{title:"this is the title of my event", start: new Date(), duration: 90}}));

#winning!

Calendar Generator

Need to generate an add-to-calendar widget on the fly? No problem, go here.

GitHub Project Page

Official Project Page

License

MIT

add-to-calendar-buttons's People

Contributors

carlsednaoui avatar maryrosecook 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.