Sha256: 83d22cbbf02407fb0bbd2715e78fb35f1f71cf2189068e4ca68aa12970dc6a2b

Contents?: true

Size: 314 Bytes

Versions: 23

Compression:

Stored size: 314 Bytes

Contents

# frozen_string_literal: true

require 'date'

DateTime.class_eval do
  # @return [String]
  def display_military(all = false)
    strftime(all ? '%m/%d/%Y %T' : '%-m/%-d/%y %T')
  end
end

Time.class_eval do
  # @return [String]
  def display_military(all = false)
    to_datetime.display_military(all)
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
ruby-rails-extensions-2.1.1 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.14 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.13 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.12 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.11 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.10 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.9 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.8 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.7 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.6 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.5 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.4 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.3 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.2 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.1.0.pre.rc.1 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.0.1 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.0.1.pre.rc.1 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.0.0 lib/ruby-rails-extensions/extensions/display_military.rb
ruby-rails-extensions-2.0.0.pre.rc.1 lib/ruby-rails-extensions/extensions/display_military.rb