Technomancy timely plugin

One of the things I've needed to do at work is provide a date/time picker for events. The datetime select stuff that's built-in to Rails is pretty pathetic in terms of UI. It gets the job done, but it definitely gives the impression of scaffolding rather than the kind of polish that belongs in a final product.

There's a neat-looking javascript calendar entry widget called Datebocks that provides a nicer interface. It was packaged into a Rails plugin by Corey Donohoe, but his plugin was for dates only rather than dates and time. I made some modifications to it so it works with datetime as well. You should be able to just use it as a drop-in replacement after installing the plugin and running rake calendar:assets:install.

Note that by default Datebocks allows you to choose from a number of date formats popular in different locales. The default is ISO format: yyyy-mm-dd HH: MM, but if you poke at the javascript, you can adjust this. There is currently no way to adjust this on the Ruby side of things, and my time additions only affect the default date format. There is some really ugly logic in the JS that discouraged me from doing a complete fix, but it's really not much work to adjust if you need another date format. But really: ISO date format should keep everyone happy; it's something fairly easy to agree upon.

And because it always helps to have a sample:

In closing, I link to Pizza Party, a unix tool for ordering pizza.

« 2007-10-13T00:00:01Z »

2007-03-21T07:17:40Z
Volker Hochstein – 2007-03-21T07:19:07Z

Unfortunetly, I cannot download the plugin from the provided url.. (tried it some days.. but everytime I just got an Apache error)
Maybe you can offer another link to get the plugin?




Thanks a lot
Volker

Phil2007-03-21T09:08:19Z

Volker:




I don’t run that repository, so there’s not a lot I can do about it. However, I packaged it up in a tarball if you want to grab that:




http://technomancy.us/code/calendar_date_selector.tar.gz

Ron2007-03-23T05:38:23Z

I got the tarball, and installed it, but keep getting “calendarIfFormat not defined ” javascript errors on the page. Any suggestions?




Ron

Phil2007-03-25T20:59:38Z

Ron: check the readme for the plugin. You shouldn’t be getting that error if you’ve added the proper javascript include lines to you layouts.

Name

URL

HTML will be escaped for now. Comments are currently moderated; sorry.