Ruby on Rails
DynamicCalendarHelper (Version #38)

By JeremyVoorhis, ShachafBenKiki?, topfunky and others

calendar_helper was created by JeremyVoorhis in 2005, with inspiration from ASP.NET’s System.Web.UI.WebControls.Calendar. calendar_helper allows you to draw a databound calendar with fine-grained CSS formatting and without introducing any new requirements for your models, routing, etc.

calendar_helper was initially released as a single file, calendar_helper.rb, but was since packaged into a plugin by Geoffrey Grosenbach of topfunky fame. Geoffrey also included several gorgeous pre-fab stylesheets in the same vein as the visual styles for his Gruff graphing library. The helper is now maintained by topfunky.

Acknowledgements also to the many good folks who emailed patches with bug fixes or reasonable features to JeremyVoorhis and topfunky.

Screenshots:
(these links no longer work!)
Databinding
Minimal configuration for maximum zen
The following snipper demonstrates how to use the helper with “special days”

<pre><%= calendar({:year => @year, :month => @month}) do |d| cell_text = "#{d.mday}<br />" cell_attrs = {:class => 'day'} @events.each do |e| if e.startdate == d cell_text << e.name << "<br />" cell_attrs[:class] = 'specialDay' end end [cell_text, cell_attrs] end %></pre>

Installation:

script/plugin install http://topfunky.net/svn/plugins/calendar_helper/

Discussion

This isnt a date_select like calendar.

I notice there is no way to get at the contents of the other month’s days using a block. Maybe you don’t actually want to display those days. Any plans plans to fix this?

I was looking through the source and found no way to display the year at the header of the calendar next to the month. That seems a little strange. Am I missing something or is there a different plugin that’s richer and more active?

@year and @month have to be integers!

I was getting these from params and it didn’t work and took me a couple of hours to figure out why. Make sure your @year and @month are integers or the calendar won’t render.

See also: DatePicker

By JeremyVoorhis, ShachafBenKiki?, topfunky and others

calendar_helper was created by JeremyVoorhis in 2005, with inspiration from ASP.NET’s System.Web.UI.WebControls.Calendar. calendar_helper allows you to draw a databound calendar with fine-grained CSS formatting and without introducing any new requirements for your models, routing, etc.

calendar_helper was initially released as a single file, calendar_helper.rb, but was since packaged into a plugin by Geoffrey Grosenbach of topfunky fame. Geoffrey also included several gorgeous pre-fab stylesheets in the same vein as the visual styles for his Gruff graphing library. The helper is now maintained by topfunky.

Acknowledgements also to the many good folks who emailed patches with bug fixes or reasonable features to JeremyVoorhis and topfunky.

Screenshots:
(these links no longer work!)
Databinding
Minimal configuration for maximum zen
The following snipper demonstrates how to use the helper with “special days”

<pre><%= calendar({:year => @year, :month => @month}) do |d| cell_text = "#{d.mday}<br />" cell_attrs = {:class => 'day'} @events.each do |e| if e.startdate == d cell_text << e.name << "<br />" cell_attrs[:class] = 'specialDay' end end [cell_text, cell_attrs] end %></pre>

Installation:

script/plugin install http://topfunky.net/svn/plugins/calendar_helper/

Discussion

This isnt a date_select like calendar.

I notice there is no way to get at the contents of the other month’s days using a block. Maybe you don’t actually want to display those days. Any plans plans to fix this?

I was looking through the source and found no way to display the year at the header of the calendar next to the month. That seems a little strange. Am I missing something or is there a different plugin that’s richer and more active?

@year and @month have to be integers!

I was getting these from params and it didn’t work and took me a couple of hours to figure out why. Make sure your @year and @month are integers or the calendar won’t render.

See also: DatePicker