
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
HtmlCalendar is an extremely lightweight/extensible gem for creating HTML calendars in Rails (>= 3.1).
Want to overwrite the built-in views? No problem. Want clean markup? It'll give you clean markup. Want a full-featured Google Calendar clone? It'll give you clean markup.
gem "html_calendar"
to your Gemfile
bundle
The html_calendar
helper makes it easy to create a calendar for any date:
<!-- a calendar for the current month -->
<%= html_calendar %>
<!-- a calender for 3 months in the future -->
<%= html_calendar Date.current + 3.months %>
If you need customized date logic, you can also pass html_calendar
a presenter:
<%= html_calendar Date.current, presenter: MyCustomDatePresenter %>
Your presenter class needs to inherit from HTMLCalendar::DatePresenter
, and
should implement the html_classes
method.
class MyCustomDatePresenter < HTMLCalendar::DatePresenter
# Available methods: `html_classes`, `date` and `template`
def html_classes
if monday?
['a-case-of-the-mundays']
else
super
end
end
private
def monday?
date.wday == 1
end
end
You can overwrite any of the view partials by creating a directory at app/views/html_calendar/calendar
and adding replacement files:
Name | Description |
---|---|
_calendar.html.erb | Main calendar loop |
_day.html.erb | Single day cell (in current month) |
_header.html.erb | Table header (including day names) |
_other_month_day.html.erb | Single day cell for days displayed but not in current month |
FAQs
Unknown package
We found that html_calendar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.