Sha256: 7e7759c4f34e0a6e60b7e22d3b825c9c6608e4957ef9a1b9becac372fac312a3

Contents?: true

Size: 460 Bytes

Versions: 1

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

class Date
  # @return [String] - mm/dd/yyyy or m/d/yy
  def display_user(all = false)
    strftime(all ? '%m/%d/%Y' : '%-m/%-d/%y')
  end
end

class DateTime
  # @return [String] - mm/dd/yyyy or m/d/yy
  def display_user(all = false)
    strftime(all ? '%m/%d/%Y %r' : '%-m/%-d/%y %r')
  end
end

class Time
  # @return [String] - mm/dd/yyyy or m/d/yy
  def display_user(all = false)
    to_datetime.display_user(all)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
display_user_extension-0.0.1 lib/display_user_extension.rb