simple_calendar 2.2.7 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "standard"
7
+ gem "rails", "~> 6.1.0"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,198 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ simple_calendar (2.4.3)
5
+ rails (>= 3.0)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ actioncable (6.1.3.2)
11
+ actionpack (= 6.1.3.2)
12
+ activesupport (= 6.1.3.2)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (6.1.3.2)
16
+ actionpack (= 6.1.3.2)
17
+ activejob (= 6.1.3.2)
18
+ activerecord (= 6.1.3.2)
19
+ activestorage (= 6.1.3.2)
20
+ activesupport (= 6.1.3.2)
21
+ mail (>= 2.7.1)
22
+ actionmailer (6.1.3.2)
23
+ actionpack (= 6.1.3.2)
24
+ actionview (= 6.1.3.2)
25
+ activejob (= 6.1.3.2)
26
+ activesupport (= 6.1.3.2)
27
+ mail (~> 2.5, >= 2.5.4)
28
+ rails-dom-testing (~> 2.0)
29
+ actionpack (6.1.3.2)
30
+ actionview (= 6.1.3.2)
31
+ activesupport (= 6.1.3.2)
32
+ rack (~> 2.0, >= 2.0.9)
33
+ rack-test (>= 0.6.3)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
+ actiontext (6.1.3.2)
37
+ actionpack (= 6.1.3.2)
38
+ activerecord (= 6.1.3.2)
39
+ activestorage (= 6.1.3.2)
40
+ activesupport (= 6.1.3.2)
41
+ nokogiri (>= 1.8.5)
42
+ actionview (6.1.3.2)
43
+ activesupport (= 6.1.3.2)
44
+ builder (~> 3.1)
45
+ erubi (~> 1.4)
46
+ rails-dom-testing (~> 2.0)
47
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
+ activejob (6.1.3.2)
49
+ activesupport (= 6.1.3.2)
50
+ globalid (>= 0.3.6)
51
+ activemodel (6.1.3.2)
52
+ activesupport (= 6.1.3.2)
53
+ activerecord (6.1.3.2)
54
+ activemodel (= 6.1.3.2)
55
+ activesupport (= 6.1.3.2)
56
+ activestorage (6.1.3.2)
57
+ actionpack (= 6.1.3.2)
58
+ activejob (= 6.1.3.2)
59
+ activerecord (= 6.1.3.2)
60
+ activesupport (= 6.1.3.2)
61
+ marcel (~> 1.0.0)
62
+ mini_mime (~> 1.0.2)
63
+ activesupport (6.1.3.2)
64
+ concurrent-ruby (~> 1.0, >= 1.0.2)
65
+ i18n (>= 1.6, < 2)
66
+ minitest (>= 5.1)
67
+ tzinfo (~> 2.0)
68
+ zeitwerk (~> 2.3)
69
+ appraisal (2.4.0)
70
+ bundler
71
+ rake
72
+ thor (>= 0.14.0)
73
+ ast (2.4.2)
74
+ builder (3.2.4)
75
+ concurrent-ruby (1.1.8)
76
+ crass (1.0.6)
77
+ diff-lcs (1.4.4)
78
+ erubi (1.10.0)
79
+ globalid (0.4.2)
80
+ activesupport (>= 4.2.0)
81
+ i18n (1.8.10)
82
+ concurrent-ruby (~> 1.0)
83
+ loofah (2.9.1)
84
+ crass (~> 1.0.2)
85
+ nokogiri (>= 1.5.9)
86
+ mail (2.7.1)
87
+ mini_mime (>= 0.1.1)
88
+ marcel (1.0.1)
89
+ method_source (1.0.0)
90
+ mini_mime (1.0.3)
91
+ mini_portile2 (2.5.1)
92
+ minitest (5.14.4)
93
+ nio4r (2.5.7)
94
+ nokogiri (1.11.3)
95
+ mini_portile2 (~> 2.5.0)
96
+ racc (~> 1.4)
97
+ nokogiri (1.11.3-x86_64-darwin)
98
+ racc (~> 1.4)
99
+ nokogiri (1.11.3-x86_64-linux)
100
+ racc (~> 1.4)
101
+ parallel (1.20.1)
102
+ parser (3.0.1.1)
103
+ ast (~> 2.4.1)
104
+ racc (1.5.2)
105
+ rack (2.2.3)
106
+ rack-test (1.1.0)
107
+ rack (>= 1.0, < 3)
108
+ rails (6.1.3.2)
109
+ actioncable (= 6.1.3.2)
110
+ actionmailbox (= 6.1.3.2)
111
+ actionmailer (= 6.1.3.2)
112
+ actionpack (= 6.1.3.2)
113
+ actiontext (= 6.1.3.2)
114
+ actionview (= 6.1.3.2)
115
+ activejob (= 6.1.3.2)
116
+ activemodel (= 6.1.3.2)
117
+ activerecord (= 6.1.3.2)
118
+ activestorage (= 6.1.3.2)
119
+ activesupport (= 6.1.3.2)
120
+ bundler (>= 1.15.0)
121
+ railties (= 6.1.3.2)
122
+ sprockets-rails (>= 2.0.0)
123
+ rails-dom-testing (2.0.3)
124
+ activesupport (>= 4.2.0)
125
+ nokogiri (>= 1.6)
126
+ rails-html-sanitizer (1.3.0)
127
+ loofah (~> 2.3)
128
+ railties (6.1.3.2)
129
+ actionpack (= 6.1.3.2)
130
+ activesupport (= 6.1.3.2)
131
+ method_source
132
+ rake (>= 0.8.7)
133
+ thor (~> 1.0)
134
+ rainbow (3.0.0)
135
+ rake (13.0.3)
136
+ regexp_parser (2.1.1)
137
+ rexml (3.2.5)
138
+ rspec (3.10.0)
139
+ rspec-core (~> 3.10.0)
140
+ rspec-expectations (~> 3.10.0)
141
+ rspec-mocks (~> 3.10.0)
142
+ rspec-core (3.10.1)
143
+ rspec-support (~> 3.10.0)
144
+ rspec-expectations (3.10.1)
145
+ diff-lcs (>= 1.2.0, < 2.0)
146
+ rspec-support (~> 3.10.0)
147
+ rspec-mocks (3.10.2)
148
+ diff-lcs (>= 1.2.0, < 2.0)
149
+ rspec-support (~> 3.10.0)
150
+ rspec-support (3.10.2)
151
+ rubocop (1.14.0)
152
+ parallel (~> 1.10)
153
+ parser (>= 3.0.0.0)
154
+ rainbow (>= 2.2.2, < 4.0)
155
+ regexp_parser (>= 1.8, < 3.0)
156
+ rexml
157
+ rubocop-ast (>= 1.5.0, < 2.0)
158
+ ruby-progressbar (~> 1.7)
159
+ unicode-display_width (>= 1.4.0, < 3.0)
160
+ rubocop-ast (1.5.0)
161
+ parser (>= 3.0.1.1)
162
+ rubocop-performance (1.11.2)
163
+ rubocop (>= 1.7.0, < 2.0)
164
+ rubocop-ast (>= 0.4.0)
165
+ ruby-progressbar (1.11.0)
166
+ sprockets (4.0.2)
167
+ concurrent-ruby (~> 1.0)
168
+ rack (> 1, < 3)
169
+ sprockets-rails (3.2.2)
170
+ actionpack (>= 4.0)
171
+ activesupport (>= 4.0)
172
+ sprockets (>= 3.0.0)
173
+ standard (1.1.1)
174
+ rubocop (= 1.14.0)
175
+ rubocop-performance (= 1.11.2)
176
+ thor (1.1.0)
177
+ tzinfo (2.0.4)
178
+ concurrent-ruby (~> 1.0)
179
+ unicode-display_width (2.0.0)
180
+ websocket-driver (0.7.3)
181
+ websocket-extensions (>= 0.1.0)
182
+ websocket-extensions (0.1.5)
183
+ zeitwerk (2.4.2)
184
+
185
+ PLATFORMS
186
+ ruby
187
+ x86_64-darwin-20
188
+ x86_64-linux
189
+
190
+ DEPENDENCIES
191
+ appraisal
192
+ rails (~> 6.1.0)
193
+ rspec
194
+ simple_calendar!
195
+ standard
196
+
197
+ BUNDLED WITH
198
+ 2.2.20
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "standard"
7
+ gem "rails", github: "rails/rails"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,207 @@
1
+ GIT
2
+ remote: https://github.com/rails/rails.git
3
+ revision: f250208dd477e879f16a0cea51bc5c399651107d
4
+ specs:
5
+ actioncable (6.2.0.alpha)
6
+ actionpack (= 6.2.0.alpha)
7
+ activesupport (= 6.2.0.alpha)
8
+ nio4r (~> 2.0)
9
+ websocket-driver (>= 0.6.1)
10
+ actionmailbox (6.2.0.alpha)
11
+ actionpack (= 6.2.0.alpha)
12
+ activejob (= 6.2.0.alpha)
13
+ activerecord (= 6.2.0.alpha)
14
+ activestorage (= 6.2.0.alpha)
15
+ activesupport (= 6.2.0.alpha)
16
+ mail (>= 2.7.1)
17
+ actionmailer (6.2.0.alpha)
18
+ actionpack (= 6.2.0.alpha)
19
+ actionview (= 6.2.0.alpha)
20
+ activejob (= 6.2.0.alpha)
21
+ activesupport (= 6.2.0.alpha)
22
+ mail (~> 2.5, >= 2.5.4)
23
+ rails-dom-testing (~> 2.0)
24
+ actionpack (6.2.0.alpha)
25
+ actionview (= 6.2.0.alpha)
26
+ activesupport (= 6.2.0.alpha)
27
+ rack (~> 2.0, >= 2.0.9)
28
+ rack-test (>= 0.6.3)
29
+ rails-dom-testing (~> 2.0)
30
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
31
+ actiontext (6.2.0.alpha)
32
+ actionpack (= 6.2.0.alpha)
33
+ activerecord (= 6.2.0.alpha)
34
+ activestorage (= 6.2.0.alpha)
35
+ activesupport (= 6.2.0.alpha)
36
+ nokogiri (>= 1.8.5)
37
+ actionview (6.2.0.alpha)
38
+ activesupport (= 6.2.0.alpha)
39
+ builder (~> 3.1)
40
+ erubi (~> 1.4)
41
+ rails-dom-testing (~> 2.0)
42
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
43
+ activejob (6.2.0.alpha)
44
+ activesupport (= 6.2.0.alpha)
45
+ globalid (>= 0.3.6)
46
+ activemodel (6.2.0.alpha)
47
+ activesupport (= 6.2.0.alpha)
48
+ activerecord (6.2.0.alpha)
49
+ activemodel (= 6.2.0.alpha)
50
+ activesupport (= 6.2.0.alpha)
51
+ activestorage (6.2.0.alpha)
52
+ actionpack (= 6.2.0.alpha)
53
+ activejob (= 6.2.0.alpha)
54
+ activerecord (= 6.2.0.alpha)
55
+ activesupport (= 6.2.0.alpha)
56
+ marcel (~> 0.3.1)
57
+ mimemagic (~> 0.3.2)
58
+ activesupport (6.2.0.alpha)
59
+ concurrent-ruby (~> 1.0, >= 1.0.2)
60
+ i18n (>= 1.6, < 2)
61
+ minitest (>= 5.1)
62
+ tzinfo (~> 2.0)
63
+ zeitwerk (~> 2.3)
64
+ rails (6.2.0.alpha)
65
+ actioncable (= 6.2.0.alpha)
66
+ actionmailbox (= 6.2.0.alpha)
67
+ actionmailer (= 6.2.0.alpha)
68
+ actionpack (= 6.2.0.alpha)
69
+ actiontext (= 6.2.0.alpha)
70
+ actionview (= 6.2.0.alpha)
71
+ activejob (= 6.2.0.alpha)
72
+ activemodel (= 6.2.0.alpha)
73
+ activerecord (= 6.2.0.alpha)
74
+ activestorage (= 6.2.0.alpha)
75
+ activesupport (= 6.2.0.alpha)
76
+ bundler (>= 1.15.0)
77
+ railties (= 6.2.0.alpha)
78
+ sprockets-rails (>= 2.0.0)
79
+ railties (6.2.0.alpha)
80
+ actionpack (= 6.2.0.alpha)
81
+ activesupport (= 6.2.0.alpha)
82
+ method_source
83
+ rake (>= 0.8.7)
84
+ thor (~> 1.0)
85
+
86
+ PATH
87
+ remote: ..
88
+ specs:
89
+ simple_calendar (2.4.3)
90
+ rails (>= 3.0)
91
+
92
+ GEM
93
+ remote: http://rubygems.org/
94
+ specs:
95
+ appraisal (2.4.0)
96
+ bundler
97
+ rake
98
+ thor (>= 0.14.0)
99
+ ast (2.4.2)
100
+ builder (3.2.4)
101
+ concurrent-ruby (1.1.8)
102
+ crass (1.0.6)
103
+ diff-lcs (1.4.4)
104
+ erubi (1.10.0)
105
+ globalid (0.4.2)
106
+ activesupport (>= 4.2.0)
107
+ i18n (1.8.10)
108
+ concurrent-ruby (~> 1.0)
109
+ loofah (2.9.1)
110
+ crass (~> 1.0.2)
111
+ nokogiri (>= 1.5.9)
112
+ mail (2.7.1)
113
+ mini_mime (>= 0.1.1)
114
+ marcel (0.3.3)
115
+ mimemagic (~> 0.3.2)
116
+ method_source (1.0.0)
117
+ mimemagic (0.3.10)
118
+ nokogiri (~> 1)
119
+ rake
120
+ mini_mime (1.1.0)
121
+ mini_portile2 (2.5.1)
122
+ minitest (5.14.4)
123
+ nio4r (2.5.7)
124
+ nokogiri (1.11.3)
125
+ mini_portile2 (~> 2.5.0)
126
+ racc (~> 1.4)
127
+ nokogiri (1.11.3-x86_64-darwin)
128
+ racc (~> 1.4)
129
+ nokogiri (1.11.3-x86_64-linux)
130
+ racc (~> 1.4)
131
+ parallel (1.20.1)
132
+ parser (3.0.1.1)
133
+ ast (~> 2.4.1)
134
+ racc (1.5.2)
135
+ rack (2.2.3)
136
+ rack-test (1.1.0)
137
+ rack (>= 1.0, < 3)
138
+ rails-dom-testing (2.0.3)
139
+ activesupport (>= 4.2.0)
140
+ nokogiri (>= 1.6)
141
+ rails-html-sanitizer (1.3.0)
142
+ loofah (~> 2.3)
143
+ rainbow (3.0.0)
144
+ rake (13.0.3)
145
+ regexp_parser (2.1.1)
146
+ rexml (3.2.5)
147
+ rspec (3.10.0)
148
+ rspec-core (~> 3.10.0)
149
+ rspec-expectations (~> 3.10.0)
150
+ rspec-mocks (~> 3.10.0)
151
+ rspec-core (3.10.1)
152
+ rspec-support (~> 3.10.0)
153
+ rspec-expectations (3.10.1)
154
+ diff-lcs (>= 1.2.0, < 2.0)
155
+ rspec-support (~> 3.10.0)
156
+ rspec-mocks (3.10.2)
157
+ diff-lcs (>= 1.2.0, < 2.0)
158
+ rspec-support (~> 3.10.0)
159
+ rspec-support (3.10.2)
160
+ rubocop (1.14.0)
161
+ parallel (~> 1.10)
162
+ parser (>= 3.0.0.0)
163
+ rainbow (>= 2.2.2, < 4.0)
164
+ regexp_parser (>= 1.8, < 3.0)
165
+ rexml
166
+ rubocop-ast (>= 1.5.0, < 2.0)
167
+ ruby-progressbar (~> 1.7)
168
+ unicode-display_width (>= 1.4.0, < 3.0)
169
+ rubocop-ast (1.5.0)
170
+ parser (>= 3.0.1.1)
171
+ rubocop-performance (1.11.2)
172
+ rubocop (>= 1.7.0, < 2.0)
173
+ rubocop-ast (>= 0.4.0)
174
+ ruby-progressbar (1.11.0)
175
+ sprockets (4.0.2)
176
+ concurrent-ruby (~> 1.0)
177
+ rack (> 1, < 3)
178
+ sprockets-rails (3.2.2)
179
+ actionpack (>= 4.0)
180
+ activesupport (>= 4.0)
181
+ sprockets (>= 3.0.0)
182
+ standard (1.1.1)
183
+ rubocop (= 1.14.0)
184
+ rubocop-performance (= 1.11.2)
185
+ thor (1.1.0)
186
+ tzinfo (2.0.4)
187
+ concurrent-ruby (~> 1.0)
188
+ unicode-display_width (2.0.0)
189
+ websocket-driver (0.7.3)
190
+ websocket-extensions (>= 0.1.0)
191
+ websocket-extensions (0.1.5)
192
+ zeitwerk (2.4.2)
193
+
194
+ PLATFORMS
195
+ ruby
196
+ x86_64-darwin-20
197
+ x86_64-linux
198
+
199
+ DEPENDENCIES
200
+ appraisal
201
+ rails!
202
+ rspec
203
+ simple_calendar!
204
+ standard
205
+
206
+ BUNDLED WITH
207
+ 2.2.20
@@ -1,4 +1,4 @@
1
- require 'rails/generators'
1
+ require "rails/generators"
2
2
 
3
3
  module SimpleCalendar
4
4
  module Generators
@@ -6,7 +6,7 @@ module SimpleCalendar
6
6
  source_root File.expand_path("../../../..", __FILE__)
7
7
 
8
8
  def copy_views
9
- directory 'app/views/simple_calendar', 'app/views/simple_calendar'
9
+ directory "app/views/simple_calendar", "app/views/simple_calendar"
10
10
  end
11
11
  end
12
12
  end
@@ -1,4 +1,4 @@
1
- require 'rails'
1
+ require "rails"
2
2
 
3
3
  module SimpleCalendar
4
4
  class Calendar
@@ -6,16 +6,16 @@ module SimpleCalendar
6
6
 
7
7
  attr_accessor :view_context, :options
8
8
 
9
- def initialize(view_context, opts={})
9
+ def initialize(view_context, opts = {})
10
10
  @view_context = view_context
11
11
  @options = opts
12
12
 
13
13
  # Next and previous view links should use the same params as the current view
14
- @params = @view_context.respond_to?(:params) ? @view_context.params : Hash.new
14
+ @params = @view_context.respond_to?(:params) ? @view_context.params : {}
15
15
  @params = @params.to_unsafe_h if @params.respond_to?(:to_unsafe_h)
16
16
  @params = @params.with_indifferent_access.except(*PARAM_KEY_BLACKLIST)
17
17
 
18
- # Add in any additonal params the user passed in
18
+ # Add in any additional params the user passed in
19
19
  @params.merge!(@options.fetch(:params, {}))
20
20
  end
21
21
 
@@ -23,7 +23,7 @@ module SimpleCalendar
23
23
  view_context.render(
24
24
  partial: partial_name,
25
25
  locals: {
26
- block: block,
26
+ passed_block: block,
27
27
  calendar: self,
28
28
  date_range: date_range,
29
29
  start_date: start_date,
@@ -35,93 +35,93 @@ module SimpleCalendar
35
35
  def td_classes_for(day)
36
36
  today = Date.current
37
37
 
38
- td_class = ['day']
39
- td_class << "wday-#{day.wday.to_s}"
40
- td_class << 'today' if today == day
41
- td_class << 'past' if today > day
42
- td_class << 'future' if today < day
43
- td_class << 'start-date' if day.to_date == start_date.to_date
44
- td_class << 'prev-month' if start_date.month != day.month && day < start_date
45
- td_class << 'next-month' if start_date.month != day.month && day > start_date
46
- td_class << 'current-month' if start_date.month == day.month
47
- td_class << 'has-events' if sorted_events.fetch(day, []).any?
38
+ td_class = ["day"]
39
+ td_class << "wday-#{day.wday}"
40
+ td_class << "today" if today == day
41
+ td_class << "past" if today > day
42
+ td_class << "future" if today < day
43
+ td_class << "start-date" if day.to_date == start_date.to_date
44
+ td_class << "prev-month" if start_date.month != day.month && day < start_date
45
+ td_class << "next-month" if start_date.month != day.month && day > start_date
46
+ td_class << "current-month" if start_date.month == day.month
47
+ td_class << "has-events" if sorted_events.fetch(day, []).any?
48
48
 
49
49
  td_class
50
50
  end
51
51
 
52
52
  def tr_classes_for(week)
53
53
  today = Date.current
54
- tr_class = ['week']
55
- tr_class << 'current-week' if week.include?(today)
54
+ tr_class = ["week"]
55
+ tr_class << "current-week" if week.include?(today)
56
56
 
57
57
  tr_class
58
58
  end
59
59
 
60
60
  def url_for_next_view
61
- view_context.url_for(@params.merge(start_date_param => date_range.last + 1.day))
61
+ view_context.url_for(@params.merge(start_date_param => (date_range.last + 1.day).iso8601))
62
62
  end
63
63
 
64
64
  def url_for_previous_view
65
- view_context.url_for(@params.merge(start_date_param => date_range.first - 1.day))
65
+ view_context.url_for(@params.merge(start_date_param => (date_range.first - 1.day).iso8601))
66
+ end
67
+
68
+ def date_range
69
+ (start_date..(start_date + additional_days.days)).to_a
66
70
  end
67
71
 
68
72
  private
69
73
 
70
- def partial_name
71
- @options[:partial] || self.class.name.underscore
72
- end
74
+ def partial_name
75
+ @options[:partial] || self.class.name.underscore
76
+ end
73
77
 
74
- def attribute
75
- options.fetch(:attribute, :start_time).to_sym
76
- end
78
+ def attribute
79
+ options.fetch(:attribute, :start_time).to_sym
80
+ end
77
81
 
78
- def end_attribute
79
- options.fetch(:end_attribute, :end_time).to_sym
80
- end
82
+ def end_attribute
83
+ options.fetch(:end_attribute, :end_time).to_sym
84
+ end
81
85
 
82
- def start_date_param
83
- options.fetch(:start_date_param, :start_date).to_sym
84
- end
86
+ def start_date_param
87
+ options.fetch(:start_date_param, :start_date).to_sym
88
+ end
85
89
 
86
- def sorted_events
87
- @sorted_events ||= begin
88
- events = options.fetch(:events, []).reject { |e| e.send(attribute).nil? }.sort_by(&attribute)
89
- group_events_by_date(events)
90
- end
90
+ def sorted_events
91
+ @sorted_events ||= begin
92
+ events = options.fetch(:events, []).reject { |e| e.send(attribute).nil? }.sort_by(&attribute)
93
+ group_events_by_date(events)
91
94
  end
95
+ end
92
96
 
93
- def group_events_by_date(events)
94
- events_grouped_by_date = Hash.new {|h,k| h[k] = [] }
97
+ def group_events_by_date(events)
98
+ events_grouped_by_date = Hash.new { |h, k| h[k] = [] }
95
99
 
96
- events.each do |event|
97
- event_start_date = event.send(attribute).to_date
98
- event_end_date = (event.respond_to?(end_attribute) && !event.send(end_attribute).nil?) ? event.send(end_attribute).to_date : event_start_date
99
- (event_start_date..event_end_date.to_date).each do |enumerated_date|
100
- events_grouped_by_date[enumerated_date] << event
101
- end
100
+ events.each do |event|
101
+ event_start_date = event.send(attribute).to_date
102
+ event_end_date = event.respond_to?(end_attribute) && !event.send(end_attribute).nil? ? event.send(end_attribute).to_date : event_start_date
103
+ (event_start_date..event_end_date.to_date).each do |enumerated_date|
104
+ events_grouped_by_date[enumerated_date] << event
102
105
  end
103
-
104
- events_grouped_by_date
105
106
  end
106
107
 
107
- def start_date
108
- if options.has_key?(:start_date)
109
- options.fetch(:start_date).to_date
110
- else
111
- view_context.params.fetch(start_date_param, Date.current).to_date
112
- end
113
- end
108
+ events_grouped_by_date
109
+ end
114
110
 
115
- def end_date
116
- date_range.last
111
+ def start_date
112
+ if options.has_key?(:start_date)
113
+ options.fetch(:start_date).to_date
114
+ else
115
+ view_context.params.fetch(start_date_param, Date.current).to_date
117
116
  end
117
+ end
118
118
 
119
- def date_range
120
- (start_date..(start_date + additional_days.days)).to_a
121
- end
119
+ def end_date
120
+ date_range.last
121
+ end
122
122
 
123
- def additional_days
124
- options.fetch(:number_of_days, 4) - 1
125
- end
123
+ def additional_days
124
+ options.fetch(:number_of_days, 4) - 1
125
+ end
126
126
  end
127
127
  end