Sha256: ac5eaa0f4d2c4861dd83724603a75986167c6e6b9b6b12cb4e1d470140cbe2c7
Contents?: true
Size: 977 Bytes
Versions: 1
Compression:
Stored size: 977 Bytes
Contents
# frozen_string_literal: true module Mail module Jdec module CommonDateFieldPatch def element super rescue Mail::Field::ParseError => e if Jdec.enabled? @errors = [name, value, e] @element = nil else raise e end end def date_time if Jdec.enabled? if element begin ::DateTime.parse("#{element.date_string} #{element.time_string}") rescue ArgumentError => e require 'time' begin Time.parse(value).to_datetime rescue ArgumentError => e nil end end else nil end else super end end end end end klasses = ObjectSpace.each_object(Class).select { |klass| klass < Mail::CommonDateField } klasses.each do |klass| klass.prepend Mail::Jdec::CommonDateFieldPatch end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mail-jdec-1.2.0 | lib/mail/jdec/fields/common_date_field_patch.rb |