Sha256: 2b26c84edceaaea6638880403a2d06ab471e6421eb222ae3ab9738e47f30386a

Contents?: true

Size: 295 Bytes

Versions: 3

Compression:

Stored size: 295 Bytes

Contents

# frozen_string_literal: true

require 'date'

Date.class_eval do
  # @return [String] - yyyy-mm-dd
  def input(_all = false)
    strftime('%F')
  end
end

DateTime.class_eval do
  # @return [String] - yyyy-mm-dd[Thh:mm::ss]
  def input(all = false)
    strftime(all ? '%F %T' : '%F')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
input_extension-0.1.0 lib/input_extension.rb
input_extension-1.0.1 lib/input_extension.rb
input_extension-1.0.1.pre.rc.1 lib/input_extension.rb