Sha256: 6edff79ba96b248f49964cc7e1d0ef00ae1884dbbf240c1c9a3dc97873a91a84

Contents?: true

Size: 525 Bytes

Versions: 4

Compression:

Stored size: 525 Bytes

Contents

module Tenon
  class EventDecorator < ApplicationDecorator
    def display_date
      if @object.starts_at.to_date == @object.ends_at.to_date
        "#{@object.starts_at.strftime('%B %d, %Y')} #{I18n.t('tenon.events.from')} #{@object.starts_at.strftime('%I:%M%p')} #{I18n.t('tenon.events.until')} #{@object.ends_at.strftime('%I:%M%p')}"
      else
        "#{@object.starts_at.strftime("%B %d, %Y at %I:%M%p")} #{I18n.t('tenon.events.until')} #{@object.ends_at.strftime("%B %d, %Y at %I:%M%p")}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tenon-1.1.8 app/decorators/tenon/event_decorator.rb
tenon-1.1.7 app/decorators/tenon/event_decorator.rb
tenon-1.1.6 app/decorators/tenon/event_decorator.rb
tenon-1.1.5 app/decorators/tenon/event_decorator.rb