Class: PureForm::Types::DateTimeType
Instance Method Summary
collapse
Methods inherited from BaseType
#initialize
Instance Method Details
#complex_typecast(*args) ⇒ Object
10
11
12
13
14
|
# File 'lib/pure_form/types/date_time.rb', line 10
def complex_typecast(*args)
DateTime.new(*args)
rescue TypeError, ArgumentError, NoMethodError
nil
end
|
#typecast(value) ⇒ Object
4
5
6
7
8
|
# File 'lib/pure_form/types/date_time.rb', line 4
def typecast(value)
value.to_datetime
rescue TypeError, ArgumentError, NoMethodError
nil
end
|