Method: Kiss::Format::DateTime.parse
- Defined in:
- lib/kiss/format.rb
.parse(value, context = {}) ⇒ Object
117 118 119 120 121 |
# File 'lib/kiss/format.rb', line 117 def parse(value, context = {}) return nil unless value =~ /\S/ relative_time = context[:year] ? ::Time.parse("1/1/#{context[:year]}") : ::Time.now convert_value_local_to_utc(::Time.parse(value.gsub(/[-\.]/, '/'), relative_time), context) end |