Project Wonder 5.0

Package er.chronic

ERChronic is a nearly direct port to Java of the Ruby Chronic library.

See:
          Description

Class Summary
Chronic  
ChronicFormatter ChronicFormatter attempts to parse a date using an expected date format, and then falls back to using Chronic in the event of a parse failure.
Options  
 

Package er.chronic Description

ERChronic is a nearly direct port to Java of the Ruby Chronic library. Currently neither Ruby Chronic nor ERChronic are internationalized, though extending the parsers to support additional languages is probably not terribly complicated (most are just a set of regular expressions, etc).

Using Chronic is very simple:

Span result = Chronic.parse("two weeks from today");

A Span object can represent either a point in time or a range of times. If a Span represents a point in time, result.isSingularity() will return true. Chronic.parse also has a variant that takes an Options object, which allows control of the parser behavior (specifying what "now" is, controlling how ERChronic handles ambiguous times, and several other settings).

Other examples of parseable strings:


Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.