Module: RiCal::PropertyValue::RecurrenceRule::TimeManipulation
- Included in:
- OccurrenceIncrementer
- Defined in:
- lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb
Overview
:nodoc:
Instance Method Summary collapse
- #advance_day(date_time) ⇒ Object
- #advance_month(date_time) ⇒ Object
- #advance_week(date_time) ⇒ Object
- #advance_year(date_time) ⇒ Object
- #first_day_of_month(date_time) ⇒ Object
- #first_day_of_week(wkst_day, date_time) ⇒ Object
- #first_day_of_year(date_time) ⇒ Object
- #first_hour_of_day(date_time) ⇒ Object
Instance Method Details
#advance_day(date_time) ⇒ Object
6 7 8 |
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 6 def advance_day(date_time) date_time.advance(:days => 1) end |
#advance_month(date_time) ⇒ Object
22 23 24 |
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 22 def advance_month(date_time) date_time.advance(:months => 1) end |
#advance_week(date_time) ⇒ Object
14 15 16 |
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 14 def advance_week(date_time) date_time.advance(:days => 7) end |
#advance_year(date_time) ⇒ Object
30 31 32 |
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 30 def advance_year(date_time) date_time.advance(:years => 1) end |
#first_day_of_month(date_time) ⇒ Object
26 27 28 |
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 26 def first_day_of_month(date_time) date_time.change(:day => 1) end |
#first_day_of_week(wkst_day, date_time) ⇒ Object
18 19 20 |
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 18 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
34 35 36 |
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 34 def first_day_of_year(date_time) date_time.change(:month => 1, :day => 1) end |
#first_hour_of_day(date_time) ⇒ Object
10 11 12 |
# File 'lib/ri_cal/property_value/recurrence_rule/occurence_incrementer.rb', line 10 def first_hour_of_day(date_time) date_time.change(:hour => 0) end |