0.0
No commit activity in last 3 years
No release in over 3 years
An easy to use calendar for your rails app
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.4.1
~> 0.7.1
~> 2.6.1
~> 4.3.1
~> 3.0.2

Runtime

>= 3.0
 Project Readme

RailsCalendar

Gem Version Coverage Status Build Status

An easy to use calendar for your rails app.

Installation

Add this line to your application's Gemfile:

gem 'rails-calendar'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rails-calendar

Usage

Use the provided helper to render the calendar in your view:

<%= rails_calendar %>

By default the calendar will show the current month, but can be easily changed passing a Date object to the helper. For example, to render the calendar for March 2000:

<%= rails_calendar(Date.new(2000, 3)) %>

Additionally, you can specify a block that will be invoked for each day to show custom information in any calendar cell:

<%
  events = {
    '2014-03-01' => [ 'TODO 1', 'TODO 2' ],
    '2014-03-03' => [ 'TODO 3' ]
  }
%>

<%= rails_calendar(Date.new(2014, 3)) do |date| %>
  <% if events[date.to_s].present? %>
    <ul>
      <% events[date.to_s].each do |event| %>
        <li><%= event %></li>
      <% end %>
    </ul>
  <% end %>
<% end %>

Contributing

  1. Fork it ( https://github.com/rdiazv/rails_calendar/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request