aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/time_tables_helper.rb
diff options
context:
space:
mode:
authorXinhui2017-04-06 16:15:53 +0200
committerXinhui2017-04-06 16:15:59 +0200
commit4f336496d52cf024de9fbce2c6133592bb300aa5 (patch)
tree36b1efe2c797986ce046d7c60cfa8472c23d388b /app/helpers/time_tables_helper.rb
parent45a789aa0041cbfeca535a8679f3d88ccbe01757 (diff)
downloadchouette-core-4f336496d52cf024de9fbce2c6133592bb300aa5.tar.bz2
Refactoring TimeTables#show json format
Diffstat (limited to 'app/helpers/time_tables_helper.rb')
-rw-r--r--app/helpers/time_tables_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/helpers/time_tables_helper.rb b/app/helpers/time_tables_helper.rb
index 9fdb791b1..b1175d359 100644
--- a/app/helpers/time_tables_helper.rb
+++ b/app/helpers/time_tables_helper.rb
@@ -1,3 +1,9 @@
module TimeTablesHelper
+
+ def month_periode_enum(years)
+ start_date = Date.today - years.years
+ end_date = Date.today + years.years
+ (start_date..end_date).map(&:beginning_of_month).uniq.map(&:to_s)
+ end
end