In January, being inspired by Simon Willison, I came up with a combined method which would be the answer to my days of entering in dates through drop down selections .

date_select.gif

We use common terms in english to express how we identify a date coming up, or a date in the past. Such as “Next Tuesday”, “Last Month”, or even as simple as “Friday”. We clearly know which date that identifies, but until now, a computer had no idea, as far as forms were concerned.

We have in the past seen date libraries such as RUNT, and the new Chronic library for Ruby directly, but never has there been a way to enter these expressions through a form.

The solution was to be elegant, and intuitive. To be able to select a date, by entering in a grammatical term such as “Tuesday”, “14th of February”, or even a regular binary date such as “2006-12-02″ or “10-24-2006″ and all would be well as far as the input would be concerned. Ideally, the form should be able to be a universal translator to dates. Allowing the input of any expression, and outputting whatever the database expects.

example_expressions.gif

To add to the elegance, the JSCalendar was also to be integrated. So when you found yourself looking for a specific date, one which no expression would be able to match (yet), then you directly choose what you want from a handy DHTML calendar.

So, DateBocks was born. The culmination of a DHTML calendar, and most importantly with the ability to enter in gramatical expressions for the date selection.

datebocks_field_expanded.gif

I invite you to try it out on the live demo and see for yourself just how useful this tool really is. And hopefully, you may very well find yourself using it or wishing you were using it - whenever you enter a date.