simple_calendar 2.1.4 → 2.1.5
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/README.md +2 -2
- data/app/views/simple_calendar/_calendar.html.erb +6 -4
- data/app/views/simple_calendar/_month_calendar.html.erb +6 -4
- data/app/views/simple_calendar/_week_calendar.html.erb +6 -4
- data/lib/simple_calendar/calendar.rb +10 -10
- data/lib/simple_calendar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee54f122b99caa56554d7a2460d03ce4f908d601
|
4
|
+
data.tar.gz: ade58551f991b9c6d3509c40168dc759d55c52f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b095272aa825af1b5f0e86f1dcba946a226bd259c12d0a010dee842c7cf9fbb62e132cfe36ec8eef7e15512e91768f42c84baafa6aa914dcdf407446049b9b9a
|
7
|
+
data.tar.gz: c489d8ed9b0d466880194c0e40153428b9639e5b084c5cfbfae585d9181979a52462485ed6e21a19e2f11928b4ab7c0634f3caf4784ce84a6030acd521b70244
|
data/README.md
CHANGED
@@ -256,13 +256,13 @@ For example, if you'd like to use abbreviated month names, you can modify
|
|
256
256
|
the views from this:
|
257
257
|
|
258
258
|
```erb
|
259
|
-
<%=
|
259
|
+
<%= t('date.month_names')[start_date.month] %> <%= start_date.year %>
|
260
260
|
```
|
261
261
|
|
262
262
|
To
|
263
263
|
|
264
264
|
```erb
|
265
|
-
<%=
|
265
|
+
<%= t('date.abbr_month_names')[start_date.month] %> <%= start_date.year %>
|
266
266
|
```
|
267
267
|
|
268
268
|
Your calendar will now display "Sep 2015" instead of "September 2015" at
|
@@ -1,13 +1,15 @@
|
|
1
1
|
<div class="simple-calendar">
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
<div class="calendar-heading">
|
3
|
+
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
|
4
|
+
<span class="calendar-title"><%= t('date.month_names')[start_date.month] %> <%= start_date.year %></span>
|
5
|
+
<%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
|
6
|
+
</div>
|
5
7
|
|
6
8
|
<table class="table table-striped">
|
7
9
|
<thead>
|
8
10
|
<tr>
|
9
11
|
<% date_range.slice(0, 7).each do |day| %>
|
10
|
-
<th><%=
|
12
|
+
<th><%= t('date.abbr_day_names')[day.wday] %></th>
|
11
13
|
<% end %>
|
12
14
|
</tr>
|
13
15
|
</thead>
|
@@ -1,13 +1,15 @@
|
|
1
1
|
<div class="simple-calendar">
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
<div class="calendar-heading">
|
3
|
+
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
|
4
|
+
<span class="calendar-title"><%= t('date.month_names')[start_date.month] %> <%= start_date.year %></span>
|
5
|
+
<%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
|
6
|
+
</div>
|
5
7
|
|
6
8
|
<table class="table table-striped">
|
7
9
|
<thead>
|
8
10
|
<tr>
|
9
11
|
<% date_range.slice(0, 7).each do |day| %>
|
10
|
-
<th><%=
|
12
|
+
<th><%= t('date.abbr_day_names')[day.wday] %></th>
|
11
13
|
<% end %>
|
12
14
|
</tr>
|
13
15
|
</thead>
|
@@ -1,13 +1,15 @@
|
|
1
1
|
<div class="simple-calendar">
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
<div class="calendar-heading">
|
3
|
+
<%= link_to t('simple_calendar.previous', default: 'Previous'), calendar.url_for_previous_view %>
|
4
|
+
<span class="calendar-title">Week <%= start_date.strftime("%U").to_i %></span>
|
5
|
+
<%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
|
6
|
+
</div>
|
5
7
|
|
6
8
|
<table class="table table-striped">
|
7
9
|
<thead>
|
8
10
|
<tr>
|
9
11
|
<% date_range.slice(0, 7).each do |day| %>
|
10
|
-
<th><%=
|
12
|
+
<th><%= t('date.abbr_day_names')[day.wday] %></th>
|
11
13
|
<% end %>
|
12
14
|
</tr>
|
13
15
|
</thead>
|
@@ -29,18 +29,18 @@ module SimpleCalendar
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def td_classes_for(day)
|
32
|
-
today =
|
32
|
+
today = Date.current
|
33
33
|
|
34
|
-
td_class = [
|
34
|
+
td_class = ['day']
|
35
35
|
td_class << "wday-#{day.wday.to_s}"
|
36
|
-
td_class <<
|
37
|
-
td_class <<
|
38
|
-
td_class <<
|
36
|
+
td_class << 'today' if today == day
|
37
|
+
td_class << 'past' if today > day
|
38
|
+
td_class << 'future' if today < day
|
39
39
|
td_class << 'start-date' if day.to_date == start_date.to_date
|
40
|
-
td_class <<
|
41
|
-
td_class <<
|
42
|
-
td_class <<
|
43
|
-
td_class <<
|
40
|
+
td_class << 'prev-month' if start_date.month != day.month && day < start_date
|
41
|
+
td_class << 'next-month' if start_date.month != day.month && day > start_date
|
42
|
+
td_class << 'current-month' if start_date.month == day.month
|
43
|
+
td_class << 'has-events' if sorted_events.fetch(day, []).any?
|
44
44
|
|
45
45
|
td_class
|
46
46
|
end
|
@@ -74,7 +74,7 @@ module SimpleCalendar
|
|
74
74
|
if options.has_key?(:start_date)
|
75
75
|
options.fetch(:start_date).to_date
|
76
76
|
else
|
77
|
-
view_context.params.fetch(:start_date, Date.
|
77
|
+
view_context.params.fetch(:start_date, Date.current).to_date
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
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.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|