Skip to content

Commit 907cabf

Browse files
committed
Fixed bug where passed ID for day cell would throw error on missing class name.
1 parent a95f1d4 commit 907cabf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

History.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
=== ???
2+
3+
* Fixed bug where passed ID for day cell would throw error on missing class name.
4+
15
=== 0.2.2 / 2007-08-29
26

37
* Fixed missing tr tag in thead section. [Ian Struble]

lib/calendar_helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ def calendar(options = {}, &block)
128128
first.upto(last) do |cur|
129129
cell_text, cell_attrs = block.call(cur)
130130
cell_text ||= cur.mday
131-
cell_attrs ||= {:class => options[:day_class]}
131+
cell_attrs ||= {}
132+
cell_attrs[:class] ||= options[:day_class]
132133
cell_attrs[:class] += " weekendDay" if [0, 6].include?(cur.wday)
133134
cell_attrs[:class] += " today" if (cur == Date.today) and options[:show_today]
134135
cell_attrs = cell_attrs.map {|k, v| %(#{k}="#{v}") }.join(" ")

0 commit comments

Comments
 (0)