simple_calendar 2.2.0 → 2.2.1

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: 8eae1b807d337ea3455ee73edfc5f72347d76f03
4
- data.tar.gz: 31892462fa9549830caacf088c2bf5e29257e3be
3
+ metadata.gz: 0cb97fa05082bdaa301e5d13bb75b0bc888531ad
4
+ data.tar.gz: c0e8070b8ce3705e582fdc9bd24e430a4b22822f
5
5
  SHA512:
6
- metadata.gz: 6b1f60f31bc3f24e674bfabb1b29a4b8976fb9e0750b8cdb4a74ce443e6ebcce13903c25aa9591bfc9682895b534c077c66283af42f84f23f876ea9b05aeba2e
7
- data.tar.gz: b5ee956d4ee2764ddee313684693f36fecaa5bf4120d98d69d7b4a6995845d3334bdc11ecb5d92478b3bb9afaffa7dc0c2f2a5a77bdd048dd52a66a1df59a898
6
+ metadata.gz: 878dd38f42449b3c813c0036c3e32638cbfd550e27790a76cc110aca05299a7057eef33fe4c1e2ae4937d04d4013f5c729398f331cb44ab2513debe662d735d7
7
+ data.tar.gz: 4ce2c239c63d8803aa078e5d1a88546099a9111ebdfa884726ef80d29a0aa221a509bf3dc27f3d800833a0436e0ab8c5d3c68edf86933bb5f82c58b90481306e
@@ -1,7 +1,7 @@
1
1
  <div class="simple-calendar">
2
2
  <div class="calendar-heading">
3
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>
4
+ <span class="calendar-title">Week <%= calendar.week_number %></span>
5
5
  <%= link_to t('simple_calendar.next', default: 'Next'), calendar.url_for_next_view %>
6
6
  </div>
7
7
 
@@ -1,3 +1,3 @@
1
1
  module SimpleCalendar
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
@@ -1,5 +1,10 @@
1
1
  module SimpleCalendar
2
2
  class WeekCalendar < SimpleCalendar::Calendar
3
+ def week_number
4
+ format = (Date.beginning_of_week == :sunday) ? "%U" : "%W"
5
+ start_date.strftime(format).to_i
6
+ end
7
+
3
8
  private
4
9
 
5
10
  def date_range
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.2.0
4
+ version: 2.2.1
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-09-24 00:00:00.000000000 Z
11
+ date: 2016-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails