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.
- data/lib/ice_cube/rules/weekly_rule.rb +9 -2
- data/lib/ice_cube/version.rb +1 -1
- metadata +2 -2
@@ -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
|
-
|
12
|
-
|
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
|
data/lib/ice_cube/version.rb
CHANGED