Home

Awesome

Calendar Plugin for Phonegap

(c) 2013 Ten Forward Consulting, Inc. released under the MIT License

Authored by Brian Samson (@samsonasu) and Ryan Behnke

This plugin is compatible with PhoneGap 2.0, and the api was based on the corresponding iOS plugin

Adding the Plugin to your project

  1. To install the plugin, add calendar.js to your index.html and to your www folder:

<script type="text/javascript" src="calendar.js"></script>

  1. Add CalendarPlugin.java to your Android project in src/com/tenforwardconsulting/phonegap/plugins

  2. Map the plugin in res/xml/config.xml:

    <plugin name="CalendarPlugin" value="com.tenforwardconsulting.phonegap.plugins.CalendarPlugin"/>

Usage

Create an object to be used to call the defined plugin methods.

var startDate = new Date("August 20, 2013 10:00:00");
var endDate = new Date("August 20, 2013 11:00:00");
var title = "Hack on Phonegap";
var location = "The Basement";
var notes = "Hacking on open source projects late at night is the best!";
var success = function() { alert("woo hoo!"); };
var error = function(message) { alert("Doh!"); };
window.plugins.calendarPlugin.createEvent(title,location,notes,startDate,endDate, success, error);

That's it!

Caveats