Skip to content

Instantly share code, notes, and snippets.

@amiel
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amiel/9282930 to your computer and use it in GitHub Desktop.
Save amiel/9282930 to your computer and use it in GitHub Desktop.
HTMLCalendar date presenter example
class MyCustomDatePresenter < HTMLCalendar::DatePresenter
# Available methods: `date` and `template`
# The only required method
def html_classes
if monday?
['a-case-of-the-mundays']
else
[]
end
end
private
def monday?
date.wday == 1
end
end
<section>
<%= html_calendar Date.current, presenter: MyCustomDatePresenter %>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment