event_calendar

Generates HTML event calendars

Installation

gem install event_calendar

Usage

Basic

@event_calendar = EventCalendar.new(2009, 10, :events => Event.all)
puts @event_calendar.to_html

Options

The EventCalendar.new method accepts a hash or block of options, for example:

@event_calendar = EventCalendar.new(2009, 10, :id => 'calendar', :events => Event.all)

@event_calendar = EventCalendar.new(2009, 10) do |c|
  c.id = 'calendar'
  c.events = Event.all
end

See the documentation for the EventCalendar class at rdoc.info/projects/shuber/event_calendar for a list of available options.

Assets

rake event_calendar:generate:css      # Generates css for the event calendar
rake event_calendar:generate:js       # Generates js for the event calendar
rake event_calendar:generate:sandbox  # Creates a sandbox in the current working directory for testing

Note

The default css was built on YUI (See developer.yahoo.com/yui) and javascript on Prototype (See www.prototypejs.org).

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but

    bump version in a commit by itself I can ignore when I pull)
    
  • Send me a pull request. Bonus points for topic branches.

TODO

  • Break Markaby template down into sections so that it’s easier to overwrite certain parts

  • Dynamic height calculations for calendar days in JavaScript

  • jQuery support

Copyright © 2009 Sean Huber. See MIT-LICENSE for details.