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

- (Object) date_time

Returns a date time object of the parsed date



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

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

- (Object) default



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

def default
  date_time
end

- (Object) parse(val = value)



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

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