Module: MongoidOccurrences::Occurrence
- Defined in:
- lib/mongoid_occurrences/occurrence.rb,
lib/mongoid_occurrences/occurrence/has_schedule.rb,
lib/mongoid_occurrences/occurrence/has_operators.rb,
lib/mongoid_occurrences/occurrence/has_daily_occurrences.rb
Defined Under Namespace
Modules: ClassMethods, HasDailyOccurrences, HasOperators, HasSchedule
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Method Details
#adjust_dates_for_all_day! ⇒ Object
47
48
49
50
51
52
53
|
# File 'lib/mongoid_occurrences/occurrence.rb', line 47
def adjust_dates_for_all_day!
return unless all_day?
return unless dtstart? && dtend?
self.dtstart = dtstart.beginning_of_day
self.dtend = dtend.end_of_day
end
|
#all_day ⇒ Object
Also known as:
all_day?
38
39
40
41
42
43
44
|
# File 'lib/mongoid_occurrences/occurrence.rb', line 38
def all_day
return super unless dtstart.present? && dtend.present?
return super unless super.nil?
dtstart.to_i == dtstart.beginning_of_day.to_i &&
dtend.to_i == dtend.end_of_day.to_i
end
|