simple_calendar 2.1.4 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a3293209cb111cf3fddc7e913e2e497f323d900
4
- data.tar.gz: 54fa1eb6598d20528822a824b7552780a36a8f7b
3
+ metadata.gz: ee54f122b99caa56554d7a2460d03ce4f908d601
4
+ data.tar.gz: ade58551f991b9c6d3509c40168dc759d55c52f5
5
5
  SHA512:
6
- metadata.gz: c49ade1df0f5f836cfdffb86629fbe563e291c836a5b75b4018f4081c33e9f95d8bf30ce595b67f2e70cf705f62ed1c2a877de4a47f00f4839ab85ce89dcf988
7
- data.tar.gz: 9db41f6d77625101675df30b48d0bd0217b44027fb1b3f6a468a7331190e53492c89698185610a9f01db06dc99a5048ac2ef948b69059d23609e8657bf2556b9
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
- <%= I18n.t("date.month_names")[start_date.month] %> <%= start_date.year %>
259
+ <%= t('date.month_names')[start_date.month] %> <%= start_date.year %>
260
260
  ```
261
261
 
262
262
  To
263
263
 
264
264
  ```erb
265
- <%= I18n.t("date.abbr_month_names")[start_date.month] %> <%= start_date.year %>
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
- <%= link_to I18n.t('simple_calendar.previous', :default => "Previous"), calendar.url_for_previous_view %>
3
- <%= I18n.t("date.month_names")[start_date.month] %> <%= start_date.year %>
4
- <%= link_to I18n.t('simple_calendar.next', :default => "Next"), calendar.url_for_next_view %>
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><%= I18n.t("date.abbr_day_names")[day.wday] %></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
- <%= link_to I18n.t('simple_calendar.previous', :default => "Previous"), calendar.url_for_previous_view %>
3
- <%= I18n.t("date.month_names")[start_date.month] %> <%= start_date.year %>
4
- <%= link_to I18n.t('simple_calendar.next', :default => "Next"), calendar.url_for_next_view %>
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><%= I18n.t("date.abbr_day_names")[day.wday] %></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
- <%= link_to I18n.t('simple_calendar.previous', :default => "Previous"), calendar.url_for_previous_view %>
3
- Week <%= start_date.strftime("%U").to_i %>
4
- <%= link_to I18n.t('simple_calendar.next', :default => "Next"), calendar.url_for_next_view %>
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><%= I18n.t("date.abbr_day_names")[day.wday] %></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 = Time.zone.now.to_date
32
+ today = Date.current
33
33
 
34
- td_class = ["day"]
34
+ td_class = ['day']
35
35
  td_class << "wday-#{day.wday.to_s}"
36
- td_class << "today" if today == day
37
- td_class << "past" if today > day
38
- td_class << "future" if today < day
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 << "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?
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.today).to_date
77
+ view_context.params.fetch(:start_date, Date.current).to_date
78
78
  end
79
79
  end
80
80
 
@@ -1,3 +1,3 @@
1
1
  module SimpleCalendar
2
- VERSION = "2.1.4"
2
+ VERSION = "2.1.5"
3
3
  end
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
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-05-24 00:00:00.000000000 Z
11
+ date: 2016-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails