Skip navigation links
Project Wonder 7.5-SNAPSHOT

Package er.chronic

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

See: Description

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:

Skip navigation links
Last updated: Sun, Dec 22, 2024 • 04:08 PM CET

Copyright © 2002 – 2024 Project Wonder.