class Chronic::Parser
def initialize(options = {})
two digit year is `now + x years` it's assumed to be the
look x amount of years into the future and past. If the
to assume the full year using this figure. Chronic will
(ie 79) unlike Rubys Time class, Chronic will attempt
:ambiguous_year_future_bias - When parsing two digit years
fourth month by setting this to [:little, :middle].
can tell Chronic to parse this as the third day of the
as the fourth day of the third month. Alternatively you
:endian_precedence - By default, Chronic will parse "03/04/2011"
matching instance of that time will be used.
is given, no assumption will be made, and the first
5:00, it would assume that means 5:00pm. If `:none`
look for the time between 7am and 7pm. In the case of
example, if you set it to `7`, then the parser will
that time in the AM to that time in the PM. For
(like 5:00) will be assumed to be within the range of
:ambiguous_time_range - If an Integer is given, ambiguous times
and :begin for first time from span.
will return last time from Span, to :middle for middle (same as just true)
and a Chronic::Span will be returned. Setting :guess to :end
entire time span returned, set this to false
for the given date or time. If you'd rather have the
:guess - By default the parser will guess a single point in time
:hours24 - Time will be parsed as it would be 24 hour clock.
instead of Time.now.
:now - Time, all computations will be based off of time
given, it will assume it is in the past.
this value to :past and if an ambiguous string is
:context - If your string represents a birthday, you can set
options - An optional Hash of configuration options:
def initialize(options = {}) @options = DEFAULT_OPTIONS.merge(options) @now = options.delete(:now) || Chronic.time_class.now end