Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.46 KB

README.md

File metadata and controls

35 lines (27 loc) · 1.46 KB

JSON ➡️ .ics

A micro CLI to create .ics files from a JSON file.

Where can I use this?

This is particularly convenient if you use the iOS Simulator to develop apps that have calendar integration. Dragging the .ics file to the Simulator will allow you to add the event to the calendar with one click.

This can also be useful for any other case in which you need .ics files to be created systematically.

Installation

$ gem install eventmaker

Usage

The first thing you need is to create a file with the event information in the form of JSON, here's one example:

{
  "name" : "Event name",
  "organizer": "[email protected]",
  "start" : "2016/12/25 19:00",
  "end": "2016/12/25 21:00",
  "attendees": ["[email protected]", "[email protected]", "[email protected]"]
}

Once you have this file saved somewhere, you can run:

$ eventmaker ~/location/to/file.json >> ./event.ics

Supported fields

For the moment, the only supported event fields are the ones listed in the example above. If you feel like you could benefit from a field that is not supported, I'll gladly accept a PR adding it 😉.

If you are not really sure how to do that, it is really easy. Basically, there are two parts to it:

  1. Take a look at lib/eventmaker.rb to see how the event information is read from the JSON file.
  2. See icalendar docs and look for the field that you want to support.