ice_cube 0.4.4 → 0.4.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.
@@ -8,8 +8,15 @@ module IceCube
8
8
  def in_interval?(date, start_date)
9
9
  #make sure we're in the right interval
10
10
  date = adjust(date, start_date)
11
- week_of_year = Date.civil(date.year, date.month, date.day).cweek
12
- week_of_year % @interval == 0
11
+
12
+ date = Date.civil(date.year, date.month, date.day)
13
+ start_date = Date.civil(start_date.year, start_date.month, start_date.day)
14
+
15
+ #Move both to the start of their respective weeks,
16
+ #and find the number of full weeks between them
17
+ no_weeks = ((date - date.wday) - (start_date - start_date.wday)) / 7
18
+
19
+ no_weeks % @interval == 0
13
20
  end
14
21
 
15
22
  def to_ical
@@ -1,5 +1,5 @@
1
1
  module IceCube
2
2
 
3
- VERSION = '0.4.4'
3
+ VERSION = '0.4.5'
4
4
 
5
5
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 4
9
- version: 0.4.4
8
+ - 5
9
+ version: 0.4.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Crepezzi