ical 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ical/calendar_helper.rb +4 -2
- data/lib/ical/version.rb +1 -1
- metadata +1 -1
data/lib/ical/calendar_helper.rb
CHANGED
@@ -32,6 +32,7 @@ module CalendarHelper
|
|
32
32
|
options = options_from_hash(args)
|
33
33
|
day_method = options.delete(:day_method) || :date
|
34
34
|
id_pattern = options.delete(:id) || 'day-%d'
|
35
|
+
special_klass = options.delete(:special_klass) || nil
|
35
36
|
|
36
37
|
# status
|
37
38
|
tbody do
|
@@ -48,7 +49,7 @@ module CalendarHelper
|
|
48
49
|
yield(day, nil)
|
49
50
|
concat("</td>")
|
50
51
|
end
|
51
|
-
concat(tag(:td, td_options(day, id_pattern, status), true))
|
52
|
+
concat(tag(:td, td_options(day, id_pattern, status, special_klass), true))
|
52
53
|
yield(day, objects)
|
53
54
|
concat('</td>')
|
54
55
|
concat('</tr>') if(day.wday == @calendar.last_weekday)
|
@@ -62,7 +63,7 @@ module CalendarHelper
|
|
62
63
|
@calendar.objects_for_days(@objects)
|
63
64
|
end
|
64
65
|
|
65
|
-
def td_options(day, id_pattern, status)
|
66
|
+
def td_options(day, id_pattern, status, special_klass)
|
66
67
|
options = {}
|
67
68
|
css_classes = []
|
68
69
|
css_classes << 'today' if day.strftime("%Y-%m-%d") == @today.strftime("%Y-%m-%d")
|
@@ -71,6 +72,7 @@ module CalendarHelper
|
|
71
72
|
css_classes << 'weekend' if day.wday == 0 or day.wday == 6
|
72
73
|
css_classes << 'future' if day > @today.to_date
|
73
74
|
css_classes << status
|
75
|
+
css_classes << special_klass if special_klass
|
74
76
|
options[:class] = css_classes.join(' ') unless css_classes.empty?
|
75
77
|
options[:id] = day.strftime(id_pattern) if id_pattern
|
76
78
|
options
|
data/lib/ical/version.rb
CHANGED