Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- app/controllers/repositories_controller.rb
Instance Method Summary collapse
Instance Method Details
#months_ago(date = Date.today) ⇒ Object
346 347 348 |
# File 'app/controllers/repositories_controller.rb', line 346 def months_ago(date = Date.today) (date.year - self.year)*12 + (date.month - self.month) end |
#weeks_ago(date = Date.today) ⇒ Object
350 351 352 |
# File 'app/controllers/repositories_controller.rb', line 350 def weeks_ago(date = Date.today) (date.year - self.year)*52 + (date.cweek - self.cweek) end |