kalenteri

Description

A gem for building calendars. Designed to be framework-agnostic.

At the moment this library is mostly for html generation. However, it should be easy to extend the Calendar class for other purposes.

Install

Add Github as gem source (unless you already have it) $ gem sources -a gems.github.com

$ sudo gem install ajk-kalenteri

Synopsis

require 'kalenteri'

# creates a new calendar object with monday as first weekday.
cal = Kalenteri::HTMLCalendar(Kalenteri::MONDAY)

# A HTML table for single month...
basic_month = cal.format_month(2009, 10)
# ...and for the whole year.
basic_year = cal.format_year(2009)

# You can use a block with the format method.
# A Date object will be passed for each day.
# The block should return a string which will be
# used inside the table cells.
detailed_month = cal.format_month(2009, 10) do |day|
  my_day_details(day)
end

Support

Bugs? Problems? Questions?

[email protected]

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.

Copyright © 2009 Antti Koskinen. See LICENSE for details.