simple_calendar 2.3.0 → 2.4.0
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.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +12 -0
- data/CHANGELOG.md +8 -0
- data/app/views/simple_calendar/_calendar.html.erb +3 -3
- data/app/views/simple_calendar/_month_calendar.html.erb +3 -3
- data/app/views/simple_calendar/_week_calendar.html.erb +3 -3
- data/lib/simple_calendar/calendar.rb +2 -2
- data/lib/simple_calendar/version.rb +1 -1
- data/lib/simple_calendar/week_calendar.rb +1 -1
- data/spec/calendars/month_calendar_spec.rb +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 994f74fe8cc221e2a6b74c3f57d24391d9214e9ad511ca03ba24a986ff0082c1
|
4
|
+
data.tar.gz: 4473aab5073e486696990218578198c35627d5fd8429bff8fb8e02a845f14b4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91bcb6559bafdbe99cc18e0b6f1f6a373b5485908e0ad2622a8e2a2d5e8481e3d3bc884161a9164bd6859d2e2fc6729c715827bc7e1af5a1b91f2de5879e09d2
|
7
|
+
data.tar.gz: 7b2c6dfafab0edfecb1444fb14b6709ae89a9f324b6d64086bf4541df8001b9ee81c58f4229e96e10cdb73ba284a59d0e3abadfbe188e7cd15f546abef7be6b7
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# These are supported funding model platforms
|
2
|
+
|
3
|
+
github: [excid3] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
4
|
+
patreon: # Replace with a single Patreon username
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
11
|
+
otechie: # Replace with a single Otechie username
|
12
|
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
### 2.4.0
|
2
|
+
|
3
|
+
* [BREAKING] Fixes Rails 4.2 by changing `block` to `passed_block`. A
|
4
|
+
security fix in Rails makes `block` a reserved local name that we can
|
5
|
+
no longer use.
|
6
|
+
|
7
|
+
**Upgrading**: If you've customized the simple_calendar views, rename
|
8
|
+
`block` to `passed_block`. Without this, calendar dates will be empty.
|
@@ -19,10 +19,10 @@
|
|
19
19
|
<%= content_tag :tr, class: calendar.tr_classes_for(week) do %>
|
20
20
|
<% week.each do |day| %>
|
21
21
|
<%= content_tag :td, class: calendar.td_classes_for(day) do %>
|
22
|
-
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(
|
23
|
-
<% capture_haml(day, sorted_events.fetch(day, []), &
|
22
|
+
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
|
23
|
+
<% capture_haml(day, sorted_events.fetch(day, []), &passed_block) %>
|
24
24
|
<% else %>
|
25
|
-
<%
|
25
|
+
<% passed_block.call day, sorted_events.fetch(day, []) %>
|
26
26
|
<% end %>
|
27
27
|
<% end %>
|
28
28
|
<% end %>
|
@@ -19,10 +19,10 @@
|
|
19
19
|
<tr>
|
20
20
|
<% week.each do |day| %>
|
21
21
|
<%= content_tag :td, class: calendar.td_classes_for(day) do %>
|
22
|
-
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(
|
23
|
-
<% capture_haml(day, sorted_events.fetch(day, []), &
|
22
|
+
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
|
23
|
+
<% capture_haml(day, sorted_events.fetch(day, []), &passed_block) %>
|
24
24
|
<% else %>
|
25
|
-
<%
|
25
|
+
<% passed_block.call day, sorted_events.fetch(day, []) %>
|
26
26
|
<% end %>
|
27
27
|
<% end %>
|
28
28
|
<% end %>
|
@@ -23,10 +23,10 @@
|
|
23
23
|
<tr>
|
24
24
|
<% week.each do |day| %>
|
25
25
|
<%= content_tag :td, class: calendar.td_classes_for(day) do %>
|
26
|
-
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(
|
27
|
-
<% capture_haml(day, sorted_events.fetch(day, []), &
|
26
|
+
<% if defined?(Haml) && respond_to?(:block_is_haml?) && block_is_haml?(passed_block) %>
|
27
|
+
<% capture_haml(day, sorted_events.fetch(day, []), &passed_block) %>
|
28
28
|
<% else %>
|
29
|
-
<%
|
29
|
+
<% passed_block.call day, sorted_events.fetch(day, []) %>
|
30
30
|
<% end %>
|
31
31
|
<% end %>
|
32
32
|
<% end %>
|
@@ -15,7 +15,7 @@ module SimpleCalendar
|
|
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
|
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
|
-
|
26
|
+
passed_block: block,
|
27
27
|
calendar: self,
|
28
28
|
date_range: date_range,
|
29
29
|
start_date: start_date,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module SimpleCalendar
|
2
2
|
class WeekCalendar < SimpleCalendar::Calendar
|
3
3
|
def week_number
|
4
|
-
format = (Date.beginning_of_week == :sunday) ? "%U" : "%
|
4
|
+
format = (Date.beginning_of_week == :sunday) ? "%U" : "%V"
|
5
5
|
start_date.beginning_of_week.strftime(format).to_i
|
6
6
|
end
|
7
7
|
|
@@ -10,8 +10,8 @@ describe SimpleCalendar::MonthCalendar do
|
|
10
10
|
today = Date.today
|
11
11
|
calendar = SimpleCalendar::MonthCalendar.new(ViewContext.new, start_date: Date.today)
|
12
12
|
|
13
|
-
expect(calendar.date_range.min).to be
|
14
|
-
expect(calendar.date_range.max).to be
|
13
|
+
expect(calendar.date_range.min).to be <= today.beginning_of_month
|
14
|
+
expect(calendar.date_range.max).to be >= today.end_of_month
|
15
15
|
end
|
16
16
|
|
17
17
|
it 'render the days of next and previous months on the edges of the calendar' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -45,9 +45,11 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- ".github/FUNDING.yml"
|
48
49
|
- ".gitignore"
|
49
50
|
- ".rspec"
|
50
51
|
- ".travis.yml"
|
52
|
+
- CHANGELOG.md
|
51
53
|
- Gemfile
|
52
54
|
- LICENSE.txt
|
53
55
|
- README.md
|
@@ -93,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
95
|
- !ruby/object:Gem::Version
|
94
96
|
version: '0'
|
95
97
|
requirements: []
|
96
|
-
|
97
|
-
rubygems_version: 2.7.6
|
98
|
+
rubygems_version: 3.1.2
|
98
99
|
signing_key:
|
99
100
|
specification_version: 4
|
100
101
|
summary: A simple Rails calendar
|