aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/time_tables_helper.rb
diff options
context:
space:
mode:
authorMarc Florisson2012-09-10 21:35:49 +0200
committerMarc Florisson2012-09-10 21:35:49 +0200
commit8024e9a869c3eeb4ca752206a7fb3add9559de13 (patch)
tree4263eec873112888a8bd198a01887e2a798d0154 /app/helpers/time_tables_helper.rb
parentabcb13a2e4dff2b155ff25f20b5ba6e7b1f2d5f7 (diff)
downloadchouette-core-8024e9a869c3eeb4ca752206a7fb3add9559de13.tar.bz2
Add feature on TimeTables. Refs #118
Diffstat (limited to 'app/helpers/time_tables_helper.rb')
-rw-r--r--app/helpers/time_tables_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/time_tables_helper.rb b/app/helpers/time_tables_helper.rb
index a7607f7a0..b6dc3de48 100644
--- a/app/helpers/time_tables_helper.rb
+++ b/app/helpers/time_tables_helper.rb
@@ -1,4 +1,13 @@
module TimeTablesHelper
+ def time_table_state_code(time_table)
+ if time_table.validity_out_from_on?(Date.today)
+ "validity_out"
+ elsif time_table.validity_out_between?(Date.today,Date.today+7.day)
+ "validity_out_soon"
+ else
+ "validity_regular"
+ end
+ end
def bounding_info(time_table)
return t('time_tables.time_table.empty') if time_table.bounding_dates.empty?
t('time_tables.time_table.bounding',