Sha256: 85a01e5069850da3eac302a264bddc59633c9dd9f9f0263833b9c29a5b3419e7

Contents?: true

Size: 276 Bytes

Versions: 16

Compression:

Stored size: 276 Bytes

Contents

module Decanter
  module Parser
    class DateTimeParser < ValueParser

      allow DateTime

      parser do |val, options|
        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

16 entries across 16 versions & 1 rubygems

Version Path
decanter-1.1.10 lib/decanter/parser/datetime_parser.rb
decanter-1.1.8 lib/decanter/parser/datetime_parser.rb
decanter-1.1.7 lib/decanter/parser/datetime_parser.rb
decanter-1.1.6 lib/decanter/parser/datetime_parser.rb
decanter-1.1.5 lib/decanter/parser/datetime_parser.rb
decanter-1.1.4 lib/decanter/parser/datetime_parser.rb
decanter-1.0.3 lib/decanter/parser/datetime_parser.rb
decanter-1.0.2 lib/decanter/parser/datetime_parser.rb
decanter-1.0.1 lib/decanter/parser/datetime_parser.rb
decanter-0.9.2 lib/decanter/parser/datetime_parser.rb
decanter-0.9.1 lib/decanter/parser/datetime_parser.rb
decanter-0.9.0 lib/decanter/parser/datetime_parser.rb
decanter-0.8.2 lib/decanter/parser/datetime_parser.rb
decanter-0.8.1 lib/decanter/parser/datetime_parser.rb
decanter-0.8.0 lib/decanter/parser/datetime_parser.rb
decanter-0.7.2 lib/decanter/parser/datetime_parser.rb