README.md in simple_calendar-2.2.7 vs README.md in simple_calendar-2.3.0

- old
+ new

@@ -22,10 +22,20 @@ Just add this into your Gemfile followed by a bundle install: ```ruby gem "simple_calendar", "~> 2.0" ``` +If you're using Bootstrap, the calendar should already have a border and +nice spacing for days. + +Optionally, you can include the default stylesheet for the calendar in +your `app/assets/stylesheets/application.css` file: + +```scss +*= require simple_calendar +``` + Usage ----- Generating calendars is extremely simple with simple_calendar. @@ -90,12 +100,10 @@ <%= calendar partial: 'products/calendar' do |date| %> <%= date %> <% end %> ``` -Setting `number_of_days` is optional and defaults to 4. - ## Rendering Events What's a calendar without events in it? There are two simple steps for creating calendars with events. @@ -195,20 +203,20 @@ ### Time Zones Setting `Time.zone` will make sure the calendar start days are correctly computed in the right timezone. You can set this globally in your `application.rb` file or if you have a User model with a time_zone attribute, you can set it on every request by using -a before_filter like the following example. +a before_action like the following example. This code example uses [Devise](https://github.com/plataformatec/devise)'s `current_user` and `user_signed_in?` methods to retrieve the user's timezone and set it for the duration of the request. Make sure to change the `:user_signed_in?` and `current_user` methods if you are using some other method of authentication. ```ruby class ApplicationController < ActionController::Base - before_filter :set_time_zone, if: :user_signed_in? + before_action :set_time_zone, if: :user_signed_in? private def set_time_zone Time.zone = current_user.time_zone @@ -224,27 +232,15 @@ ``` ### Beginning Of Week You can also change the beginning day of the week by setting -`Date.beginning_of_week` in a `before_filter` just like in the previous +`Date.beginning_of_week` in a `before_action` just like in the previous example. If you want to set this globally, you can put this line in `config/application.rb`: ```ruby config.beginning_of_week = :sunday -``` - -### Default Stylesheet - -If you're using Bootstrap, the calendar should already have a border and -nice spacing for days. - -Optionally, you can include the default stylesheet for the calendar in -your `app/assets/stylesheets/application.css` file: - -```scss -*= require simple_calendar ``` ### Custom CSS Classes Setting classes on the table and elements are pretty easy.