ice_cube 0.2.6 → 0.2.6.1
Sign up to get free protection for your applications and to get access to all the features.
data/lib/ice_cube/rule.rb
CHANGED
@@ -64,7 +64,6 @@ module IceCube
|
|
64
64
|
# Set the time when this rule will no longer be effective
|
65
65
|
def until(until_date)
|
66
66
|
raise ArgumentError.new('Cannot specify until and count on the same rule') if @count #as per rfc
|
67
|
-
raise ArgumentError.new('Argument must be a valid Time') unless until_date.class == Time
|
68
67
|
@until_date = until_date
|
69
68
|
self
|
70
69
|
end
|
@@ -20,10 +20,11 @@ module IceCube
|
|
20
20
|
protected
|
21
21
|
|
22
22
|
def default_jump(date)
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
goal = date
|
24
|
+
@interval.times do
|
25
|
+
goal += TimeUtil.days_in_month(goal) * ONE_DAY
|
26
|
+
end
|
27
|
+
adjust(goal, date)
|
27
28
|
end
|
28
29
|
|
29
30
|
private
|
@@ -21,10 +21,12 @@ module IceCube
|
|
21
21
|
|
22
22
|
# one year from now, the same month and day of the year
|
23
23
|
def default_jump(date)
|
24
|
-
#
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
#jump by months since there's no reliable way to jump by year
|
25
|
+
goal = date
|
26
|
+
(@interval * 12).times do
|
27
|
+
goal += TimeUtil.days_in_month(goal) * ONE_DAY
|
28
|
+
end
|
29
|
+
adjust(goal, date)
|
28
30
|
end
|
29
31
|
|
30
32
|
private
|
data/lib/ice_cube/schedule.rb
CHANGED
@@ -74,13 +74,11 @@ module IceCube
|
|
74
74
|
|
75
75
|
# Add an individual date to this schedule
|
76
76
|
def add_recurrence_date(date)
|
77
|
-
raise ArgumentError.new('Argument must be a valid Time') unless date.class == Time
|
78
77
|
@rdates << date
|
79
78
|
end
|
80
79
|
|
81
80
|
# Add an individual date exception to this schedule
|
82
81
|
def add_exception_date(date)
|
83
|
-
raise ArgumentError.new('Argument must be a valid Time') unless date.class == Time
|
84
82
|
@exdates << date
|
85
83
|
end
|
86
84
|
|
data/lib/ice_cube/version.rb
CHANGED