Module: Mail::CommonDate

Included in:
DateField, ResentDateField
Defined in:
lib/mail/fields/common/common_date.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#date_timeObject

Returns a date time object of the parsed date



6
7
8
# File 'lib/mail/fields/common/common_date.rb', line 6

def date_time
  ::DateTime.parse("#{element.date_string} #{element.time_string}")
end

#defaultObject



10
11
12
# File 'lib/mail/fields/common/common_date.rb', line 10

def default
  date_time
end

#parse(val = value) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/mail/fields/common/common_date.rb', line 14

def parse(val = value)
  unless Utilities.blank?(val)
    @element = Mail::DateTimeElement.new(val)
  else
    nil
  end
end