Class: Jschematic::Attributes::Format::DateTime

Inherits:
Object
  • Object
show all
Includes:
Element
Defined in:
lib/jschematic/attributes/format.rb

Instance Attribute Summary

Attributes included from Element

#id, #parent

Instance Method Summary collapse

Methods included from Element

#required?, #schema_for, #title, #to_s

Instance Method Details

#accepts?(date_time) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
64
65
# File 'lib/jschematic/attributes/format.rb', line 61

def accepts?(date_time)
  ::DateTime.strptime(date_time)
rescue ArgumentError
  false
end