Monday, June 15, 2009

rails plugin calendar_helper year added to helper

As I was working on one of the rails project which had calendar_helper plugin, which was not displaying year in the header of the calendar with month.

So I modified the calendar_helper.rb in the plugin lib directory.

Previously at line no.107 the code was
cal << %

("#{colspan}" class="#{options[:month_name_class]}">#{Date::MONTHNAMES[options[:month]]} )

just added #{options[:year]}

and modified it to

cal << %("#{colspan}" class="#{options[:month_name_class]}">#{Date::MONTHNAMES[options[:month]]} #{options[:year]})

Now month and year both displays perfectly in the calendar header

No comments:

Post a Comment