Sha256: e4c77cbee591bbd040822510457a06cf1faa492f8ab69499dc23b7bd174dd3bd

Contents?: true

Size: 505 Bytes

Versions: 12

Compression:

Stored size: 505 Bytes

Contents

module Coprl
  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

12 entries across 12 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.11 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.10 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.9 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.8 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.7 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.6 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.5 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.4 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.3 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.2 lib/coprl/presenters/helpers/date.rb
coprl-3.0.0.beta.1 lib/coprl/presenters/helpers/date.rb