Moved Date months/weeks calculations used in Graph to lib.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8540 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Etienne Massip
2012-01-07 19:02:10 +00:00
parent 1653735758
commit 59789c7997
3 changed files with 41 additions and 10 deletions
+1 -10
View File
@@ -1,5 +1,5 @@
# Redmine - project management software
# Copyright (C) 2006-2011 Jean-Philippe Lang
# Copyright (C) 2006-2012 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -366,12 +366,3 @@ class RepositoriesController < ApplicationController
end
end
class Date
def months_ago(date = Date.today)
(date.year - self.year)*12 + (date.month - self.month)
end
def weeks_ago(date = Date.today)
(date.year - self.year)*52 + (date.cweek - self.cweek)
end
end