Sha256: 36df2216666dba5a4405d27ab75bc58ba6adf70035e7aeb98e1ee7d9c7f41d6e
Contents?: true
Size: 1.01 KB
Versions: 2
Compression:
Stored size: 1.01 KB
Contents
require 'event_cal' module EventCal module CalendarHelper def wday_class_for(date) case date.wday when 0 'sunday' when 6 'saturday' end end def hightlight_classes(date, calendar) classes = [] classes << 'today' if date == Date.today events = calendar.events_on(date) classes << 'has_events' if events.present? events.map(&:class).uniq.each {|event_class| classes << event_class.to_s.underscore } classes end def previous_month_path(calendar) end def next_month_path(calendar) end def today_path(calendar) end def render_monthly(calendar) render( { :partial => 'event_cal/calendar', :format => :html, :locals => { :calendar => calendar }, } ) end def render_event_details(events) render( { :partial => 'event_cal/event_details', :format => :html, :locals => { :events => events } } ) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
event_cal-1.2.5 | lib/event_cal/calendar_helper.rb |
event_cal-1.2.4 | lib/event_cal/calendar_helper.rb |