Skip to content

Commit

Permalink
adding a data-date to each cell
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbristol committed Jun 11, 2013
1 parent 34b3bad commit 6a9e2ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/calendar_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def calendar(options = {}, &block)
cell_text, cell_attrs = block.call(cur)
cell_text ||= cur.mday
cell_attrs ||= {}
cell_attrs["data-date"] = cur
cell_attrs[:headers] = th_id(cur, options[:table_id])
cell_attrs[:class] ||= options[:day_class]
cell_attrs[:class] += " weekendDay" if [0, 6].include?(cur.wday)
Expand Down Expand Up @@ -244,6 +245,7 @@ def generate_other_month_cell(date, options)
cell_attrs[:headers] = th_id(date, options[:table_id])
cell_attrs[:class] = options[:other_month_class]
cell_attrs[:class] += " weekendDay" if weekend?(date)
cell_attrs["data-date"] = date

cell_text = date.day
if options[:accessible]
Expand Down

0 comments on commit 6a9e2ce

Please sign in to comment.