Skip to content

Commit

Permalink
Added class ec-other-month-bg to style cell backgrond.
Browse files Browse the repository at this point in the history
  • Loading branch information
felipediesel committed Jan 11, 2011
1 parent 3de78be commit d4b350c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/event_calendar/calendar_helper.rb
Expand Up @@ -167,7 +167,8 @@ def calendar(options = {}, &block)
cal << %(<tbody><tr>)
first_day_of_week.upto(first_day_of_week+6) do |day|
today_class = (day == Date.today) ? "ec-today-bg" : ""
cal << %(<td class="ec-day-bg #{today_class}">&nbsp;</td>)
other_month_class = (day < first) || (day > last) ? 'ec-other-month-bg' : ''
cal << %(<td class="ec-day-bg #{today_class} #{other_month_class}">&nbsp;</td>)
end
cal << %(</tr></tbody></table>)

Expand Down Expand Up @@ -219,6 +220,7 @@ def calendar(options = {}, &block)
cal << %(ec-event-bg" )
cal << %(style="background-color: #{event.color}; )
end

cal << %(padding-top: #{options[:event_padding_top]}px; )
cal << %(height: #{options[:event_height] - options[:event_padding_top]}px;" )
if options[:use_javascript]
Expand Down

0 comments on commit d4b350c

Please sign in to comment.