Merge pull request #195 from doncruse/master

Removing some intermediate values and shifting HTML formatting to a helper
This commit is contained in:
Matt Rogers 2013-07-22 19:44:18 -07:00
commit bcbfe42899
5 changed files with 69 additions and 63 deletions

View file

@ -4,4 +4,20 @@ module StatsHelper
9 + 2 * cloud.relative_size(tag)
end
def month_and_year_label(i)
t('date.month_names')[ (Time.now.mon - i -1 ) % 12 + 1 ]+ " " + (Time.now - i.months).year.to_s
end
def array_of_month_and_year_labels(count)
Array.new(count) { |i| month_and_year_label(i) }
end
def month_label(i)
t('date.month_names')[ (Time.now.mon - i -1 ) % 12 + 1 ]
end
def array_of_month_labels(count)
Array.new(count) { |i| month_label(i) }
end
end