A natural language date parser in Java. Originally written by Mike Schrag as a direct port of Ruby's chronic.
I've forked it out of WONDER, "an umbrella project for the WebObjects community."
<dependencies> <dependency> <groupId>com.rubiconproject.oss</groupId> <artifactId>jchronic</artifactId> <version>0.2.8</version> </dependency> </dependencies>
Parsing of two-digit years
The parsing of two-digit years can be controlled with one of the
FUTURE like this:
Options opts = new Options(Pointer.PointerType.PAST); Span result = Chronic.parse("1/2/38", options); // Year is treated as 1938 because of PointerType.PAST.
The behavior is like this:
Earlier versions of this library ignored the given options and always behaved like the
NONE line in the table.
This was originally written by Mike Schrag as part of the WONDER project.
Additional contributions have since been made by @brianm, @ewanmellor, and @samtingleff.
The MIT license. See LICENSE.