twinssbc / AngularJS-ResponsiveCalendar

A pure AngularJS responsive calendar directive
http://twinssbc.github.io/AngularJS-ResponsiveCalendar/demo/
MIT License
112 stars 77 forks source link
angular calendar

ui-rCalendar directive

A pure AngularJS responsive calendar directive

You could also check https://github.com/twinssbc/Angular-Customizable-Calendar for the Angular version.
If you want to only use it in Ionic framework, please check https://github.com/twinssbc/Ionic2-Calendar for the Ionic specific version

Demo

http://twinssbc.github.io/AngularJS-ResponsiveCalendar/demo/

Usage

Bower Install: bower install ng-responsive-calendar

Load the necessary dependent files:

<link rel="stylesheet" href="https://github.com/twinssbc/AngularJS-ResponsiveCalendar/blob/master/./lib/bootstrap/dist/css/bootstrap.css"/>
<link rel="stylesheet" href="https://github.com/twinssbc/AngularJS-ResponsiveCalendar/blob/master/<bower lib installation path>/ng-responsive-calendar/dist/css/calendar.min.css"/>
<script src="https://github.com/twinssbc/AngularJS-ResponsiveCalendar/raw/master/./lib/angular/angular.js"></script>
<script src="https://github.com/twinssbc/AngularJS-ResponsiveCalendar/raw/master/<bower lib installation path>/ng-responsive-calendar/dist/js/calendar-tpls.min.js"></script>

Add the calendar module as a dependency to your application module:

var myAppModule = angular.module('MyApp', ['ui.rCalendar'])

Add the directive in the html page

<calendar calendar-mode="mode" event-source="eventSource">

Options

EventSource

EventSource is an array of event object which contains at least below fields:

Note In the current version, the calendar controller only watches for the eventSource reference as it's the least expensive. That means only you manually reassign the eventSource value, the controller get notified, and this is usually fit to the scenario when the range is changed, you load a new data set from the backend. In case you want to manually insert/remove/update the element in the eventSource array, you can call broadcast the 'eventSourceChanged' event to notify the controller manually.

Events