duckduckgo/zeroclickinfo-goodies — pull request #576 by mintsoft (2014-08-09 21:57:59+00:00)
Title: In-Progress: Unified Date Handling role

'lo all,

Following on from the excellent work by @mwmiller to wrap calculator and numbers into a role, I'm attempting the same with date handling (to address things like this https://github.com/duckduckgo/zeroclickinfo-goodies/issues/513).

Not complete yet, however the goal will be to produce two public methods, `date_regex` and `parse_date`;
`date_regex` will output a massive regex for all the supported date formats, if they "look like dates"; but not guaranteeing that they're correct. I.e. 2014-02-31 would probably pass the match.
`parse_date` will probably return a `DateTime` of the parsed date

Feedback welcomed. I'm planning to have a ridiculously large set of tests around this
-Rob
cc @jagtalon @moollaza