simple_calendar 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -13,7 +13,7 @@ Installation
13
13
 
14
14
  Just add this into your Gemfile followed by a bundle install:
15
15
 
16
- gem "simple_calendar", "~> 0.1.5"
16
+ gem "simple_calendar", "~> 0.1.8"
17
17
 
18
18
  Usage
19
19
  -----
@@ -99,6 +99,7 @@ Possible options:
99
99
  :start_day # starting day of week, default: :sunday
100
100
  :empty_date # block called when a date is empty
101
101
  :class # HTML class attribute for the calendar
102
+ :params # Any extra params you'd like in the URL (automatically includes month and year)
102
103
 
103
104
  If you wish to have Monday as the first day of the week, you'll need to
104
105
  change a couple things. First, when rendering the calendar, use the
@@ -1,3 +1,3 @@
1
1
  module SimpleCalendar
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
@@ -12,7 +12,7 @@ module SimpleCalendar
12
12
  :next_text => raw("»"),
13
13
  :start_day => :sunday,
14
14
  :class => "table table-bordered table-striped calendar",
15
-
15
+ :params => {}
16
16
  }
17
17
  options.reverse_merge! opts
18
18
  events ||= []
@@ -96,17 +96,17 @@ module SimpleCalendar
96
96
  next_month = selected_month.advance :months => 1
97
97
  tags = []
98
98
 
99
- tags << month_link(options[:prev_text], previous_month, {:class => "previous-month"})
99
+ tags << month_link(options[:prev_text], previous_month, options[:params], {:class => "previous-month"})
100
100
  tags << "#{I18n.t("date.month_names")[selected_month.month]} #{selected_month.year}"
101
- tags << month_link(options[:next_text], next_month, {:class => "next-month"})
101
+ tags << month_link(options[:next_text], next_month, options[:params], {:class => "next-month"})
102
102
 
103
103
  tags.join.html_safe
104
104
  end
105
105
  end
106
106
 
107
107
  # Generates the link to next and previous months
108
- def month_link(text, date, opts={})
109
- link_to(text, {:month => date.month, :year => date.year}, opts)
108
+ def month_link(text, date, params, opts={})
109
+ link_to(text, params.merge({:month => date.month, :year => date.year}), opts)
110
110
  end
111
111
  end
112
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-24 00:00:00.000000000 Z
12
+ date: 2013-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -57,7 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  segments:
59
59
  - 0
60
- hash: 2090267451068015802
60
+ hash: -4140716189217531783
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  segments:
68
68
  - 0
69
- hash: 2090267451068015802
69
+ hash: -4140716189217531783
70
70
  requirements: []
71
71
  rubyforge_project: simple_calendar
72
72
  rubygems_version: 1.8.24