Sha256: 856e5b5986b4700b1b0cc3c07f87e96c95d4056d1f308e4222d66aa42c57f286
Contents?: true
Size: 530 Bytes
Versions: 20
Compression:
Stored size: 530 Bytes
Contents
# frozen_string_literal: true require 'date' DateTime.class_eval do # @return [String] - mm/dd/yyyy HH:MM:SS AM/PM or m/d/yy HH:MM:SS AM/PM def display_user(all = false) strftime(all ? '%m/%d/%Y %r' : '%-m/%-d/%y %r') end end Time.class_eval do # @return [String] - mm/dd/yyyy or m/d/yy def display_user(all = false) to_datetime.display_user(all) end end Date.class_eval do # @return [String] - mm/dd/yyyy or m/d/yy def display_user(all = false) strftime(all ? '%m/%d/%Y' : '%-m/%-d/%y') end end
Version data entries
20 entries across 20 versions & 1 rubygems