def cast_value(v)
      return nil if v.nil?
      if @type == :date
        self.style = STYLE_DATE if self.style == 0
        v
      elsif (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time))
        self.style = STYLE_DATE if self.style == 0
        # one simple little fix.  I DO NOT WANT TIME IN LOCAL TIME!
        unless v.is_a?(Time)
          v = v.respond_to?(:to_time) ? v.to_time : v
        end
        v
      elsif @type == :float
        v.to_f
      elsif @type == :integer
        v.to_i
      elsif @type == :boolean
        v ? 1 : 0
      elsif @type == :iso_8601
        #consumer is responsible for ensuring the iso_8601 format when specifying this type
        v
      else
        @type = :string
        # TODO find a better way to do this as it accounts for 30% of
        # processing time in benchmarking...
        Axlsx::trust_input ? v.to_s : ::CGI.escapeHTML(v.to_s)
      end
    end
def cast_value(v)
      return nil if v.nil?
      if @type == :date
        self.style = STYLE_DATE if self.style == 0
        v
      elsif (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time))
        self.style = STYLE_DATE if self.style == 0
        # one simple little fix.  I DO NOT WANT TIME IN LOCAL TIME!
        unless v.is_a?(Time)
          v = v.respond_to?(:to_time) ? v.to_time : v
        end
        v
      elsif @type == :float
        v.to_f
      elsif @type == :integer
        v.to_i
      elsif @type == :boolean
        v ? 1 : 0
      elsif @type == :iso_8601
        #consumer is responsible for ensuring the iso_8601 format when specifying this type
        v
      else
        @type = :string
        # TODO find a better way to do this as it accounts for 30% of
        # processing time in benchmarking...
        Axlsx::trust_input ? v.to_s : ::CGI.escapeHTML(v.to_s)
      end
    end
Fix the conversion of Date/Time values.
 :nodoc: