Smart package for SuperCalendar. Google Calendar-like as smart package
http://supercalendar.meteor.com
To install in a new project:
> meteor add gabrielhpugliese:supercalendar
-
In your body or any template, you can simply add the calendar view:
<body> {{> calendar}} </body>
-
Publish the
Calendar
data on server:Meteor.publish('calendar', function () { return Calendar.find(); });
-
Subscribe on client and set the
superCalendarReady
session var totrue
:Meteor.subscribe('calendar', function () { Session.set('superCalendarReady', true); });
client: Override pre-defined function events within SuperCalendar.events
to add your own behaviours.
Example (if you want to override a click on a day square):
SuperCalendar.events.onDayClick = function (event, template, data) {
// put your custom code here.
};
Those are events supported by now. Create an issue to request more:
- onDayClick: when users click on a day square.
- onEventClick: when users click on a registered event.
The data
param has the keys:
- date: Date() that was clicked.
- view: view that user is in.
client: Override SuperCalendar.rendered
to send your own rendered callback to Meteor. Note that you are going to implement the fullCalendar initalization. This does not override other events.
Example:
SuperCalendar.rendered = function () {
// Do something custom.
}
both: Use Calendar
collection to add events. If you don't want to publish it all, create an issue to request the removal.
Thanks for those wonderful packages I'm using:
- Anti:Modals for modals. Take a look how to to it in
client/lib/app.js
- Mesosphere for form. Take a look how to do it in
lib/forms.js
validation - FullCalendar for Google Calendar-like UI