Bootstrap Date-picker on Rails – so simple!

Implementing a datepicker – Simple ( not…!)

My RoR app is using twitter bootstrap for all my styles. Not only does this significantly reduce my need for extensive front end development, it also provides a responsive framework to enable the app to deploy to a range of devices.

The standard date field in the Twitter Bootstrap is a slightly clunky-looking set of fields for entering each component of the date (and additional fields for entering time):

Screen Shot 2013-07-03 at 4.43.28 PM

I prefer a single field, and would also like to provide a date-picker option – it’s pretty standard to offer this and I prefer to see a future date in context of weeks and months.  So I landed on the following, which displays the date picker when the field gets focus, but which also permits keyboard typing of the date:


So, with the goal set, it’s time to figure out how to actually implement this!

Continue reading