Inspired by, and copied from, Chronic. There's a video of Tom Preston-Werner discussing some of the features and the design philosophy behind Chronic.
Try it out now:
In two words: web forms. Generally, any time you ask the user to input date or time.
If you get any decent traffic on your website, you will discover that no matter what fancy date picker you use, users will still find a way to send dates (or times) in their own fancy formats. Chronicity might help in some of those cases.
The current version is 0.2.6. Download it, or get earlier releases here. To install with Quicklisp, use:
(ql:quickload :chronicity)
Or, get the latest, bleeding-edge version from github:
git clone git://github.com/chaitanyagupta/chronicity.git
Once installed, use ASDF to load:
(asdf:oos 'asdf:load-op :chronicity)
To run the test suite:
(asdf:oos 'asdf:test-op :chronicity)
Source code for chronicity-test includes lisp-unit
(see test/lisp-unit.lisp). This might cause problems (or surprises) if
your image already uses a different version of lisp-unit.
CHRONICITY:PARSE parses the datetime string.
(chronicity:parse "today")
=> @2009-03-27T13:00:00.000000+05:30
(chronicity:parse "3 days from now")
=> @2009-03-30T12:34:56.000000+05:30
(chronicity:parse "1/2/2003")
=> @2003-02-01T00:00:00.000000+05:30
To access components of the returned datetime object, use these accessors:
(chronicity:parse "next month" :guess :end)
=> @2009-04-30T23:59:59.000000+05:30
(values (chronicity:year-of *)
(chronicity:month-of *)
(chronicity:day-of *)
(chronicity:hour-of *)
(chronicity:minute-of *)
(chronicity:sec-of *))
=> 2009, 4, 30, 23, 59, 59
View the README file for more examples.
Most of the credit for Chronicity goes to Tom Preston-Werner's Ruby library, Chronic. In fact, thanks to the author's incompetence in thinking programmatically, Chronicity is basically Chronic translated from Ruby to CL.
Also, many thanks to Edi Weitz, for not only cl-ppcre, but also cl-interpol, which makes dealing with regular expressions much less painful.
For comments or bug reports, please email me, Chaitanya Gupta.
Updated: 2011-03-15