Sha256: c71301e24983d53b778ffec1098a48605980306e98c51bd4395d68f192312293

Contents?: true

Size: 447 Bytes

Versions: 79

Compression:

Stored size: 447 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')} from #{@object.starts_at.strftime('%I:%M%p')} until #{@object.ends_at.strftime('%I:%M%p')}"
      else
        "#{@object.starts_at.strftime("%B %d, %Y at %I:%M%p")} until #{@object.ends_at.strftime("%B %d, %Y at %I:%M%p")}"
      end
    end
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
tenon-1.1.4 app/decorators/tenon/event_decorator.rb
tenon-1.1.3 app/decorators/tenon/event_decorator.rb
tenon-1.1.2 app/decorators/tenon/event_decorator.rb
tenon-1.1.1 app/decorators/tenon/event_decorator.rb
tenon-1.0.76 app/decorators/tenon/event_decorator.rb
tenon-1.0.75 app/decorators/tenon/event_decorator.rb
tenon-1.0.74 app/decorators/tenon/event_decorator.rb
tenon-1.0.73 app/decorators/tenon/event_decorator.rb
tenon-1.0.72 app/decorators/tenon/event_decorator.rb
tenon-1.0.71 app/decorators/tenon/event_decorator.rb
tenon-1.0.70 app/decorators/tenon/event_decorator.rb
tenon-1.0.69 app/decorators/tenon/event_decorator.rb
tenon-1.0.68 app/decorators/tenon/event_decorator.rb
tenon-1.0.67 app/decorators/tenon/event_decorator.rb
tenon-1.0.66 app/decorators/tenon/event_decorator.rb
tenon-1.0.65 app/decorators/tenon/event_decorator.rb
tenon-1.0.64 app/decorators/tenon/event_decorator.rb
tenon-1.0.63 app/decorators/tenon/event_decorator.rb
tenon-1.0.62 app/decorators/tenon/event_decorator.rb
tenon-1.0.61 app/decorators/tenon/event_decorator.rb