Class: String
Instance Method Summary collapse
-
#to_date ⇒ Object
Use NSDataDetector to parse a string containing a date or duration.
- #to_duration ⇒ Object
- #to_timezone ⇒ Object
Instance Method Details
#to_date ⇒ Object
Use NSDataDetector to parse a string containing a date or duration. These can be of the form:
"tomorrow at 7:30 PM" "11.23.2013" "from 7:30 to 10:00 AM"
etc.
55 56 57 |
# File 'lib/sugarcube/date_parser.rb', line 55 def to_date SugarCube::DateParser.parse_date(self) end |
#to_duration ⇒ Object
63 64 65 |
# File 'lib/sugarcube/date_parser.rb', line 63 def to_duration SugarCube::DateParser.parse_duration(self) end |
#to_timezone ⇒ Object
59 60 61 |
# File 'lib/sugarcube/date_parser.rb', line 59 def to_timezone SugarCube::DateParser.parse_time_zone(self) end |