Module: RiCal::PropertyValue::RecurrenceRule::TimeManipulation

Included in:
OccurrenceIncrementer
Defined in:
lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb

Overview

  • ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license

Instance Method Summary collapse

Instance Method Details

#advance_day(date_time) ⇒ Object

:nodoc:



8
9
10
# File 'lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb', line 8

def advance_day(date_time)
  date_time.advance(:days => 1)
end

#advance_month(date_time) ⇒ Object



24
25
26
# File 'lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb', line 24

def advance_month(date_time)
  date_time.advance(:months => 1)
end

#advance_week(date_time) ⇒ Object



16
17
18
# File 'lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb', line 16

def advance_week(date_time)
  date_time.advance(:days => 7)
end

#advance_year(date_time) ⇒ Object



32
33
34
# File 'lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb', line 32

def advance_year(date_time)
  date_time.advance(:years => 1)
end

#first_day_of_month(date_time) ⇒ Object



28
29
30
# File 'lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb', line 28

def first_day_of_month(date_time)
  date_time.change(:day => 1)
end

#first_day_of_week(wkst_day, date_time) ⇒ Object



20
21
22
# File 'lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb', line 20

def first_day_of_week(wkst_day, date_time)
  date_time.at_start_of_week_with_wkst(wkst_day)
end

#first_day_of_year(date_time) ⇒ Object



36
37
38
# File 'lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb', line 36

def first_day_of_year(date_time)
  date_time.change(:month => 1, :day => 1)
end

#first_hour_of_day(date_time) ⇒ Object



12
13
14
# File 'lib/ri_cal/property_value/recurrence_rule/time_manipulation.rb', line 12

def first_hour_of_day(date_time)
  date_time.change(:hour => 0)
end