Sha256: 70060db686a7c4415157e25fae118431356a2114cf96752edd121d574f199bc9
Contents?: true
Size: 456 Bytes
Versions: 26
Compression:
Stored size: 456 Bytes
Contents
module Scrivito # Adds support for string columns which contain ISO dates module DateAttribute def self.parse(iso_date_time) return nil unless iso_date_time if iso_date_time.to_s =~ /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/ Time.utc($1.to_i, $2.to_i, $3.to_i, $4.to_i, $5.to_i, $6.to_i).in_time_zone else raise "The value is not a valid ISO date time: #{iso_date_time.inspect}" end end end end
Version data entries
26 entries across 26 versions & 1 rubygems