Class: Time

Inherits:
Object
  • Object
show all
Includes:
ShiftyWeek
Defined in:
lib/shifty_week/time.rb

Constant Summary

Constants included from ShiftyWeek

ShiftyWeek::WORKER_FORMAT

Instance Method Summary collapse

Methods included from ShiftyWeek

#days_in_month, included, #last_week_day, #month_name, #month_names, #step_to_month_end, #wday_offset, #week, #week_day_start, #week_days, #weeks_in_year

Instance Method Details

#<<(int) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/shifty_week/time.rb', line 13

def << int
#    r = self
#    (int < 0 ? int*-1 : int).times do 
#      r = r.send( (int < 0 ? "+" : "-"), (DAYS(r.days_in_month)) )
#    end
#    r += HOUR if r.dst? 
#    r
  DateTime.parse(self.strftime(WORKER_FORMAT)) << int
end

#>>(int) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/shifty_week/time.rb', line 3

def >> int
#    r = self
#    (int < 0 ? int*-1 : int).times do 
#      r = r.send( (int < 0 ? "-" : "+"), (DAYS(r.days_in_month)) )
#    end
#    r += HOUR if r.dst? 
#    r
  DateTime.parse(self.strftime(WORKER_FORMAT)) >> int
end