Cronic
Parse natural language dates and times into Time or
Cronic::Timespan objects.
Examples:
require "cronic"
Time.local
# => Sun Aug 27 23:18:25 PDT 2006
Cronic.parse("tomorrow")
# => Mon Aug 28 12:00:00 PDT 2006
Cronic.parse("monday", context: PointerDir::Past)
# => Mon Aug 21 12:00:00 PDT 2006
Constants
Class methods
Construct a new Time object determining possible month overflows
and leap years. Accounts for overflows in the values
- year - Int32 year.
- month - Int32 month.
- day - Int32 day.
- hour - Int32 hour.
- minute - Int32 minute.
- second - Int32 second.
Returns a new Time object constructed from these params.
Parses a text String containing a natural language date or time.
If the parser can find a date or time, a Time
will be returned (depending on the value of guess). If no
date/time can be found, nil will be returned.
Parses like self.parse, but will return nil if a ParseError is raised
Parses a text String containing natural language date or time.
Similar to self.parse, but returns a Cronic::Timespan of the
begin-end time for the generated time-span instead of guessing a
specific time-point during that range.
Nested types
- Cronic::AnchorDefinitions
- Cronic::ArrowDefinitions
- Cronic::Date
- Cronic::DateDefinitions
- Cronic::DateEndian
- Cronic::Direction
- Cronic::EndianDefinitions
- Cronic::Grabber
- Cronic::GrabberEnum
- Cronic::Guess
- Cronic::Handlers
- Cronic::InvalidParseError
- Cronic::MonthNames
- Cronic::NarrowDefinitions
- Cronic::Or
- Cronic::OrSeqType
- Cronic::Ordinal
- Cronic::Parser
- Cronic::Pointer
- Cronic::PointerDir
- Cronic::QuarterNames
- Cronic::Repeater
- Cronic::Scalar
- Cronic::Season
- Cronic::Separator
- Cronic::SeqMatcher
- Cronic::SeqType
- Cronic::Sequence
- Cronic::Sign
- Cronic::SpanDefinitions
- Cronic::Tag
- Cronic::TagType
- Cronic::TimeUtil
- Cronic::TimeZone
- Cronic::Timespan
- Cronic::Token
- Cronic::Tokenizer
- Cronic::UnknownParseError