From bbdbdaee9ef0c126d6117be11708a7cd192b20d6 Mon Sep 17 00:00:00 2001 From: Bruno Perles Date: Thu, 29 Oct 2015 10:35:59 +0100 Subject: Add vehicle_journey_frequency form with time band --- app/presenters/timeband_presenter.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/presenters/timeband_presenter.rb (limited to 'app/presenters/timeband_presenter.rb') 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 -- cgit v1.2.3