views:

2335

answers:

5

Looking for a date and datetime picker that will integrate fairly seamlessly with Rails. I'm sure some people must be using something similar. I have tried

  • the unobtrusive date picker plugin but it breaks with the latest release of Rails.

  • calendar date select plugin uses prototype which I have removed from my app and don't want to add back.

  • active calendar plugin - broken with latest Rails and hacked to fix but doesn't fill out the text fields when a model is loaded.

Thanks very much.

+5  A: 

Here is a good write up on one option.

http://milesich.com/timepicker/

image

There is another post here on StackOverflow on a similar topic. You are looking for something more specific to rails than the OP of this one, but it still has some good info.

RSolberg
Thanks yes I have seen this one and it looks like the most promising. However the author says it's buggy, and I was hoping to find something that can be dropped right in Rails that is backwards compatible with the default time picker (although I will probably end up using this). Thanks.
+1  A: 

The Any+Time(TM) Datepicker/Timepicker AJAX Calendar Widget uses jQuery and should work seamlessly with Rails. It provides many date/time formatting options and requires only a single line of your own JS code to attach to any text field. It also aims to minimize the number of mouse clicks necessary to select a date and/or time, and provides WAI-ARIA keyboard accessibility for users without a mouse. Did I mention Time Zone support and custom Styles/Themes using CSS and/or jQuery UI? :-)

Andrew M. Andrews III
+2  A: 

http://trentrichardson.com/examples/timepicker/

This is the best date time picker I've seen. milesich is not actively maintained anymore. There're bugs if the input field is blank. Sure there're solutions(in the comments), but if you look at the code, its one ugly hack.

Trent's implementation is much cleaner. Shorter, easy to understand and mimimal CSS to add. I highly recommend his work

liangzan
Wow, this is a nice timepicker. I've got the milesich timepicker in my (still under development) rails app and it is buggy. Was looking for a good alternative and I think this will be that alternative. Could still do with some tweaking but is the best thing I've seen yet.
brad
A: 

Liangzan. I'm also Milesich's buggy datetime picker VICTIM. Thanks for new datetime picker.

Abid

Abid
A: 

I am having trouble getting my database to recognize the date portion of my param. I assume that I need to format the datetimepicker javascript to match the format that my database is expecting, but I don't see dateFormat addressed in any of Trent's examples. For example, I am successfully submitting '"begins"=>"07/30/2010 07:30 pm"' but the resulting database entry ends up as 'begins: "2000-01-01 19:30:00"'. I wouldn't mind changing the database format instead if that would be a better solution. Any suggestions?

Micah Alcorn