Sha256: c13412b079546149b812dd8f579ab2d8ecf4a32a3023ae85de988358834ed5a7

Contents?: true

Size: 505 Bytes

Versions: 14

Compression:

Stored size: 505 Bytes

Contents

module Voom
  module Presenters
    module Helpers
      module Date
        LONG_FORMAT='%m/%d/%Y'
        SHORT_FORMAT='%d %b %Y'

        def format_date(date, format: '%m/%d/%Y')
          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

14 entries across 14 versions & 1 rubygems

Version Path
voom-presenters-0.1.13 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.12 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.11 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.10 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.9 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.8 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.7 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.6 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.5 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.4 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.3 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.2 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.1 lib/voom/presenters/helpers/date.rb
voom-presenters-0.1.0 lib/voom/presenters/helpers/date.rb