public
Description: Calendar-generating plugin for Ruby
Homepage: http://rubyonrailsworkshops.com
Clone URL: git://github.com/topfunky/calendar_helper.git
johndouthat (author)
Mon Mar 30 16:59:31 -0700 2009
topfunky (committer)
Mon Nov 02 08:38:09 -0800 2009
name age message
file .gitignore Wed Mar 25 09:22:54 -0700 2009 Be Rails timezone aware for today, just for tod... [monde]
file History.txt Thu Jan 15 16:41:17 -0800 2009 Fixed bug where passed ID for day cell would th... [topfunky]
file MIT-LICENSE Mon Nov 10 11:57:55 -0800 2008 First import [topfunky]
file Manifest.txt Mon Nov 10 11:57:55 -0800 2008 First import [topfunky]
file README.txt Thu Oct 08 14:49:09 -0700 2009 Fixed README to work better with hoe [topfunky]
file Rakefile Thu Oct 08 14:45:22 -0700 2009 Fix bug in Rakefile preventing rdoc generation [johndouthat]
file about.yml Mon Nov 10 11:57:55 -0800 2008 First import [topfunky]
directory generators/ Mon Nov 10 11:57:55 -0800 2008 First import [topfunky]
file init.rb Mon Nov 10 11:57:55 -0800 2008 First import [topfunky]
directory lib/ Mon Nov 02 08:38:09 -0800 2009 If Time's zone is nil, don't crash. [johndouthat]
directory test/ Mon Nov 10 11:57:55 -0800 2008 First import [topfunky]
README.txt
= CalendarHelper

== DESCRIPTION:

A simple helper for creating an HTML calendar. The "calendar" method will be automatically available to your view 
templates.

There is also a Rails generator that copies some stylesheets for use alone or alongside existing stylesheets.

== SYNOPSIS:

  # Simple
  calendar(:year => 2005, :month => 6)
  
  # Set table class
  calendar({:year => 2005, :month => 6, :table_class => "calendar_helper"})
  
  # Full featured
  calendar(:year => 2005, :month => 5) do |d| # This generates a simple calendar, but gives special days
    if listOfSpecialDays.include?(d)          # (days that are in the array listOfSpecialDays) one CSS class,
      [d.mday, {:class => "specialDay"}]      # "specialDay", and gives the rest of the days another CSS class,
    else                                      # "normalDay". You can also use this highlight today differently
      [d.mday, {:class => "normalDay"}]       # from the rest of the days, etc.
    end
  end

If using with ERb (Rails), put in a printing tag.

  <%= calendar(:year => @year, :month => @month, :first_day_of_week => 1) do |d|
        render_calendar_cell(d)
      end
  %>

With Haml, use a helper to set options for each cell.

  = calendar(:year => @year, :month => @month, :first_day_of_week => 1) do |d|
    - render_calendar_cell(d)

== AUTHORS:

Jeremy Voorhis -- http://jvoorhis.com
Original implementation

Geoffrey Grosenbach -- http://nubyonrails.com
Test suite and conversion to a Rails plugin

== Contributors:

* Jarkko Laine http://jlaine.net/
* Tom Armitage http://infovore.org
* Bryan Larsen http://larsen.st

== USAGE:

See the RDoc (or use "rake rdoc").

To copy the CSS files, use

  ./script/generate calendar_styles

CSS will be copied to subdirectories of public/stylesheets/calendar.