• Stars
    star
    298
  • Rank 134,746 (Top 3 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ical for javascript

ical.js

(Formerly node-ical)

Build Status

A tolerant, minimal icalendar parser for javascript/node (http://tools.ietf.org/html/rfc5545)

Install - Node.js

ical.js is availble on npm:

npm install ical

API

ical.parseICS(str)

Parses a string with an ICS File

var data = ical.parseFile(filename)

Example 1 - Print list of upcoming node conferences (see example.js)

'use strict';

const ical = require('ical');
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

const data = ical.parseICS('content from ical file');

for (let k in data) {
	if (data.hasOwnProperty(k)) {
		var ev = data[k];
		if (data[k].type == 'VEVENT') {
			console.log(`${ev.summary} is in ${ev.location} on the ${ev.start.getDate()} of ${months[ev.start.getMonth()]} at ${ev.start.toLocaleTimeString('en-GB')}`);

		}
	}
}

Recurrences and Exceptions

Calendar events with recurrence rules can be significantly more complicated to handle correctly. There are three parts to handling them:

  1. rrule - the recurrence rule specifying the pattern of recurring dates and times for the event.
  2. recurrences - an optional array of event data that can override specific occurrences of the event.
  3. exdate - an optional array of dates that should be excluded from the recurrence pattern.

See example_rrule.js for an example of handling recurring calendar events.

More Repositories

1

node-opencv

OpenCV Bindings for node.js
C++
4,351
star
2

genetic-lisa

Rust
41
star
3

WebcamParallax.js

Realtime Face Detection powers browser parallax.
JavaScript
21
star
4

rays.rust

A rust implementation of a raytracer.
Rust
13
star
5

accountant

accountant.js
JavaScript
7
star
6

goggles

images on the command line
JavaScript
6
star
7

learning-opencv-node-examples

O'Reilly Learning OpenCV - Node.js Code Translations
JavaScript
6
star
8

node-edgar

Node API for SEC Edgar Database
JavaScript
5
star
9

dotfiles

My dotfiles
Vim Script
4
star
10

travel-times

JavaScript
3
star
11

verandah

Open Source productivity web suite.
JavaScript
3
star
12

dt.js

Dates and Times, a replacement/ superset of Date()
JavaScript
3
star
13

iUi

Mirror of google code repo
JavaScript
3
star
14

notes

organisation
JavaScript
3
star
15

mockScroller.js

A os-x leopard like scrollbar replacement script
JavaScript
3
star
16

node-script-tools

Tools for writing scripts with node.js
JavaScript
2
star
17

Geoplot

Making beautiful maps with Django and PIL
Python
2
star
18

peterbraden.github.com

all the small things
JavaScript
2
star
19

history

Visualisations, Explorations in time.
JavaScript
2
star
20

peterbraden.co.uk-v4

JavaScript
2
star
21

rays

C++
2
star
22

adventures

2
star
23

jotun

Text/ HTML Analysis
JavaScript
2
star
24

fonts

type faces by me
2
star
25

temp

please note - this is out of date, and I may delete it. The new repo is at peterbraden.github.com
Python
2
star
26

Editable-Content

An abstraction layer for contentEditable
JavaScript
2
star
27

jqtouch

An inofficial clone from the Google Code SVN
JavaScript
2
star
28

peterbraden.no.de

dunno yet
JavaScript
2
star
29

jquery.nestedEditor

JavaScript
2
star
30

zoiks

JavaScript
2
star
31

linkchecker.js

JavaScript
2
star
32

workalyse

JavaScript
1
star
33

js-raytracer

JavaScript
1
star
34

insv-to-yt

Convert Insta360 .insv videos to mp4 that can be uploaded to youtube.
Shell
1
star