Sha256: 0f13d98f0858f86ee168fa11e2b51804bd1f895c73e6344e9773e02ed9c460d1

Contents?: true

Size: 508 Bytes

Versions: 18

Compression:

Stored size: 508 Bytes

Contents

# Default DATE_FORMATS available
#
# Time::DATE_FORMATS.merge!({
#     :db => "%Y-%m-%d %H:%M:%S",
#     :number => "%Y%m%d%H%M%S",
#     :time => "%H:%M",
#     :mdy => "%B %d, %Y",
#     :short => "%d %b %H:%M",
#     :long => "%B %d, %Y %H:%M"
# })
# === Example Useage
# DateTime.now().to_format(:mdy)
#
class DateTime
  # Helper method for string formatting DateTime.
  def to_format(key = :default)
    if format = ::Time::DATE_FORMATS[key]
      strftime(format)
    else
      to_s
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
grippy-doozer-0.1.0 lib/doozer/active_support/date_time.rb
grippy-doozer-0.1.1 lib/doozer/active_support/date_time.rb
grippy-doozer-0.1.2 lib/doozer/active_support/date_time.rb
grippy-doozer-0.1.3 lib/doozer/active_support/date_time.rb
grippy-doozer-0.1.4 lib/doozer/active_support/date_time.rb
grippy-doozer-0.1.5 lib/doozer/active_support/date_time.rb
doozer-0.4.4 lib/doozer/active_support/date_time.rb
doozer-0.4.3 lib/doozer/active_support/date_time.rb
doozer-0.4.2 lib/doozer/active_support/date_time.rb
doozer-0.4.1 lib/doozer/active_support/date_time.rb
doozer-0.4.0 lib/doozer/active_support/date_time.rb
doozer-0.3.1 lib/doozer/active_support/date_time.rb
doozer-0.3.0 lib/doozer/active_support/date_time.rb
doozer-0.2.6 lib/doozer/active_support/date_time.rb
doozer-0.2.5 lib/doozer/active_support/date_time.rb
doozer-0.2.2 lib/doozer/active_support/date_time.rb
doozer-0.2.1 lib/doozer/active_support/date_time.rb
doozer-0.2.0 lib/doozer/active_support/date_time.rb