aboutsummaryrefslogtreecommitdiffstats
path: root/app/presenters/timeband_presenter.rb
diff options
context:
space:
mode:
authorBruno Perles2015-10-29 10:35:59 +0100
committerBruno Perles2015-10-29 10:35:59 +0100
commitbbdbdaee9ef0c126d6117be11708a7cd192b20d6 (patch)
tree1a235b76d30bde6561440546df14aa4af0c15b32 /app/presenters/timeband_presenter.rb
parent5b4136b2907ffc918210495d8f9a29c1e7d681fb (diff)
downloadchouette-core-bbdbdaee9ef0c126d6117be11708a7cd192b20d6.tar.bz2
Add vehicle_journey_frequency form with time band
Diffstat (limited to 'app/presenters/timeband_presenter.rb')
-rw-r--r--app/presenters/timeband_presenter.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/presenters/timeband_presenter.rb b/app/presenters/timeband_presenter.rb
new file mode 100644
index 000000000..62a29faf5
--- /dev/null
+++ b/app/presenters/timeband_presenter.rb
@@ -0,0 +1,15 @@
+class TimebandPresenter
+
+ def initialize(timeband)
+ @timeband = timeband
+ end
+
+ def title
+ if @timeband.name.blank?
+ "#{I18n.l(@timeband.start_time, format: :hour)}-#{I18n.l(@timeband.end_time, format: :hour)}"
+ else
+ @timeband.name
+ end
+ end
+
+end