aboutsummaryrefslogtreecommitdiffstats
path: root/app/presenters/timeband_presenter.rb
diff options
context:
space:
mode:
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