Sha256: c3577b8884242c004151a18a088bfe538b11f832f47da8bb498377a6c9328f2d
Contents?: true
Size: 494 Bytes
Versions: 19
Compression:
Stored size: 494 Bytes
Contents
module Seabright module Types module DateType def format_date(val) begin val.is_a?(DateTime) || val.is_a?(Date) || val.is_a?(Time) ? val : ( val.is_a?(String) ? DateTime.parse(val) : nil ) rescue StandardError => e Log.debug "Could not parse value as date using Date.parse. Returning nil instead. Value: #{val.inspect}\nError: #{e.inspect}" nil end end def score_date(val) val.to_time.to_i end end register_type :Date end end
Version data entries
19 entries across 19 versions & 1 rubygems