# File lib/mail/fields/date_field.rb, line 33 def initialize(value = nil, charset = 'utf-8') self.charset = charset if value.blank? value = ::DateTime.now.strftime('%a, %d %b %Y %H:%M:%S %z') else value = strip_field(FIELD_NAME, value) value.to_s.gsub!(/\(.*?\)/, '') value = ::DateTime.parse(value.to_s.squeeze(" ")).strftime('%a, %d %b %Y %H:%M:%S %z') end super(CAPITALIZED_FIELD, value, charset) rescue ArgumentError => e raise e unless "invalid date"==e.message end
Generated with the Darkfish Rdoc Generator 2.