DateInput.js: The fantastic date control

DateInput.js in action

One of the nice things I put together while I working on was a LowPro and Prototype-based date input control. Today, Five Points Solutions (aka MemberHub) has released it as open source:

It’s fairly easy to use. Just wire it on to text field that you would like to turn into a date input control and the DateInputBehavior does the rest. A simple line like this:

Event.addBehavior({'': DateInputBehavior()});

…will unobtrusively wire it onto all input controls with a class of “date”. It’s pretty slick. I’m sure you will like it.

Dan Webb (of LowPro fame) actually wrote a good portion of the code. We discovered date_selector.js in the LowPro repository, found that it was about half of what we wanted, and were able to modify it to suit our needs. Dan’s original version didn’t allow the calendar portion to drop down, or provide easy access for jumping forward to another year or month. We added these features, styled it up rather nicely, and have packaged the whole thing up in a nice little project on GitHub.

I, for one, am very grateful that Five Points has released their version as open source. I have plans to see that it gets integrated into a little CMS that I’m working on.

© 2013 John W. Long