Ruby on Rails Calendar Helper doesn’t quite work for me

Geoffrey Grosenbach’s Ruby on Rails plugin calendar_helper is simple and easy to use. Maybe I’m just picky, but one part of it just wasn’t working right for me.

Originally, it looks like this on line 96:

cal << %(<caption class="#{options[:month_name_class]}"></caption><thead><tr><th colspan="7">#{Date::MONTHNAMES[options[:month]]}</th></tr><tr class="#{options[:day_name_class]}">)

It doesn’t really make sense for the month name to be in a TH tag and the caption to be empty. So, I put the month name in the caption and eliminated the extra table row. In the end I changed it to this:

    cal << %(<caption class="#{options[:month_name_class]}">#{Date::MONTHNAMES[options[:month]]}</caption><thead><tr>)

This works well for me. If I knew anything about how to contribute to an open source project, I might propose a patch.

Leave a Reply

Your email address will not be published. Required fields are marked *