Class: Date

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/repositories_controller.rb

Instance Method Summary collapse

Instance Method Details

#months_ago(date = Date.today) ⇒ Object


348
349
350
# File 'app/controllers/repositories_controller.rb', line 348

def months_ago(date = Date.today)
  (date.year - self.year)*12 + (date.month - self.month)
end

#weeks_ago(date = Date.today) ⇒ Object


352
353
354
# File 'app/controllers/repositories_controller.rb', line 352

def weeks_ago(date = Date.today)
  (date.year - self.year)*52 + (date.cweek - self.cweek)
end