Sha256: 49ce9a0053d51abfd596aad7155e80572b544577a8872e5ce5ce0c3493b87d75
Contents?: true
Size: 400 Bytes
Versions: 19
Compression:
Stored size: 400 Bytes
Contents
module Decanter module Parser class DateTimeParser < ValueParser allow DateTime parser do |val, options| raise Decanter::ParseError.new 'Expects a single value' if val.is_a? Array next if (val.nil? || val === '') parse_format = options.fetch(:parse_format, '%m/%d/%Y %I:%M:%S %p') ::DateTime.strptime(val, parse_format) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems