mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-27 03:06:11 +01:00
Moving label creation to helpers
This commit is contained in:
parent
5b045d2c1a
commit
845ac14176
4 changed files with 18 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue