Class: ContentBlockTools::Presenters::FieldPresenters::TimePeriod::DateRangePresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- ContentBlockTools::Presenters::FieldPresenters::TimePeriod::DateRangePresenter
- Defined in:
- lib/content_block_tools/presenters/field_presenters/time_period/date_range_presenter.rb
Constant Summary
Constants inherited from BasePresenter
Instance Attribute Summary
Attributes inherited from BasePresenter
Instance Method Summary collapse
Methods inherited from BasePresenter
Constructor Details
This class inherits a constructor from ContentBlockTools::Presenters::FieldPresenters::BasePresenter
Instance Method Details
#render ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/content_block_tools/presenters/field_presenters/time_period/date_range_presenter.rb', line 8 def render return unless start_date.present? && end_date.present? "#{start_date} to #{end_date}" rescue Date::Error, TypeError raise TimePeriodPresenterError, "Not a valid date range: #{field}" end |