Class: Gloo::Convert::StringToDate
- Inherits:
-
Object
- Object
- Gloo::Convert::StringToDate
- Defined in:
- lib/gloo/convert/string_to_date.rb
Instance Method Summary collapse
-
#convert(value) ⇒ Object
Convert the given string value to date.
Instance Method Details
#convert(value) ⇒ Object
Convert the given string value to date.
15 16 17 18 19 20 21 22 |
# File 'lib/gloo/convert/string_to_date.rb', line 15 def convert( value ) # # TODO: figure out why I needed to add this. # The trailing ' am' was causing Chronic to fail. # value = value[0..-3] if value.end_with?( ' am' ) return Chronic.parse( value ) end |