Skip to content

Instantly share code, notes, and snippets.

@mironov
Created April 8, 2009 08:58
Show Gist options
  • Save mironov/91685 to your computer and use it in GitHub Desktop.
Save mironov/91685 to your computer and use it in GitHub Desktop.
calendar({:year => Date.today.year, :month => Date.today.month, :first_day_of_week => 1}) do |d|
cell_text = "#{d.mday}<br />"
cell_attrs = {:class => 'day'}
@incompleted_tasks.each do |task|
if task.deadline == d
cell_text << link_to(task.name, project_task_path(@project.id, task.id)) << "<br />"
if task.deadline < Date.today
cell_attrs[:class] = 'specialDayLated'
else
cell_attrs[:class] = 'specialDay'
end
end
end
[cell_text, cell_attrs]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment