Skip to content

vsuns/ics.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ics.js

Build Status NPM Version License

Pure JavaScript implementation of RFC 5545 (iCalendar).

Project Status : Paused. I may work on it later but I don't have the time for now.

Overview

Goals

  • Being able to generate and fully parse iCal files.
  • Pure JavaScript (ES5, strict mode) with no runtime dependencies.
  • Node.js and browser compatibility.

Installation

Node.js

You can install it locally:

$ npm install icsjs

or you can add it as a dependency in your package.json:

{ "dependencies" :
  {
    "icsjs" : "0.x"
  }
}

Then you just have to require it in your code:

var iCalendar = require('icsjs');

Browser

You just have to include it in your HTML:

<script src="path/to/ics.js"></script>

and it will automatically expose the iCalendar object.

Usage

Annotated source

Creating a calendar

// Let's do a party right now.
var party = new iCalendar.EventBuilder();

party.setStartDate(new Date());
party.setDuration('PT3H0M0S');

party.setSummary('Crazy party at the beach');

// But don't forget tommorow's meeting.
var meeting = new iCalendar.EventBuilder();
var tommorow = new Date(new Date().getTime() + 24 * 60 * 60 * 1000);

meeting.setStartDate(tommorow);
meeting.setDuration('PT1H0M0S');

meeting.setSummary("Financial result's presentation");

// Put that together in our calendar.
var calendar = new iCalendar.CalendarBuilder();
calendar.addEvent(party.getEvent());
calendar.addEvent(meeting.getEvent());

// And display it.
console.log(calendar.getCalendar().toString());

About

JS implementation of RFC 5545 (iCalendar).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 97.3%
  • CSS 2.4%
  • HTML 0.3%