Sha256: 955b94ed0b6bfd1b088564d3c8a44a4e72c70cb19cc1f764f5c6f442dd385fd2

Contents?: true

Size: 409 Bytes

Versions: 8

Compression:

Stored size: 409 Bytes

Contents

module ActiveZuora
  class DateField < Field

    def type_cast(value)
      return value if value.nil?
      return value.to_date if value.is_a?(Date)
      return value.to_date if value.is_a?(DateTime)
      value.to_date rescue default
    end

    def build_xml(xml, soap, value, options={})
      value = value ? value.strftime("%Y-%m-%d") : ''
      super(xml, soap, value, options)
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
active_zuora-2.6.0 lib/active_zuora/fields/date_field.rb
active_zuora-2.5.4 lib/active_zuora/fields/date_field.rb
active_zuora-2.5.3 lib/active_zuora/fields/date_field.rb
active_zuora-2.5.2 lib/active_zuora/fields/date_field.rb
active_zuora-2.5.1 lib/active_zuora/fields/date_field.rb
active_zuora-2.5.0 lib/active_zuora/fields/date_field.rb
active_zuora-2.4.1 lib/active_zuora/fields/date_field.rb
active_zuora-2.4.0 lib/active_zuora/fields/date_field.rb