ohac-ricalv 0.1.3 → 0.1.4
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/ricalv.rb +8 -1
- metadata +1 -1
data/lib/ricalv.rb
CHANGED
|
@@ -24,6 +24,13 @@ module Icalendar
|
|
|
24
24
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
# for ruby1.8
|
|
28
|
+
unless Date.method_defined?(:next_year)
|
|
29
|
+
class Date
|
|
30
|
+
def next_year(n=1) self >> n * 12 end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
27
34
|
WEEKTABLE = { 'SU' => 7, 'MO' => 1, 'TU' => 2,
|
|
28
35
|
'WE' => 3, 'TH' => 4, 'FR' => 5, 'SA' => 6 }
|
|
29
36
|
KEYS = [ 'FREQ', 'BYDAY', 'BYMONTH', 'WKST', 'UNTIL', 'INTERVAL' ]
|
|
@@ -106,7 +113,7 @@ items = calss.map { |cals|
|
|
|
106
113
|
end
|
|
107
114
|
end
|
|
108
115
|
if yearly
|
|
109
|
-
d = d.next_year
|
|
116
|
+
d = d.next_year
|
|
110
117
|
d = Date.new(d.year, mon, 1) if mon
|
|
111
118
|
while d <= ud
|
|
112
119
|
if day
|