Sha256: e624d3db1b3b7248864662cd9fb2e3bdd89a75f2af76cfad050651d6da9eaa33

Contents?: true

Size: 504 Bytes

Versions: 7

Compression:

Stored size: 504 Bytes

Contents

module Voom
  module Presenters
    module Helpers
      module Date
        LONG_FORMAT='%B %e, %Y'
        SHORT_FORMAT='%e %b'

        def format_date(date, format: LONG_FORMAT)
          date ? date.strftime(format) : ''
        end

        def format_date_long(time, format: nil)
          format_date(time, format: format||LONG_FORMAT)
        end

        def format_date_short(time, format: nil)
          format_date(time, format: format||SHORT_FORMAT)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
voom-presenters-2.1.2 lib/voom/presenters/helpers/date.rb
voom-presenters-2.1.0 lib/voom/presenters/helpers/date.rb
voom-presenters-2.0.3 lib/voom/presenters/helpers/date.rb
voom-presenters-2.0.2 lib/voom/presenters/helpers/date.rb
voom-presenters-2.0.1 lib/voom/presenters/helpers/date.rb
voom-presenters-2.0.0 lib/voom/presenters/helpers/date.rb
voom-presenters-0.2.0 lib/voom/presenters/helpers/date.rb