views:

37177

answers:

12

I've been looking around for a decent jQuery plugin that can handle both dates and times. The core UI DatePicker is great, but unfortunately I need to be able to take time in as well.

I've found a few hacks for the DatePicker to work with times, but they all seem pretty inelegant and google isn't turning up anything nice.

Do any of you know of a good jQuery plugin for selecting dates and times in a single UI control with a usable interface?

Thanks!

+3  A: 

I've had some good luck with this one:

http://code.google.com/p/dyndatetime/

Demos are here:

http://www.mechanicalmarksy.com/hosted/toolman/dyndatetime/example.html

Jon
The only issue with that is the time field is a little difficult for non-technical uses. But thanks!
fluid_chelsea
+3  A: 

I have ran into that same problem. I actually developed my using server side programming, but I did a quick search to try and help you out and found this.

Seems alright, didn't look at the source too much, but seems to be purely JavaScript.

Take look:

http://www.rainforestnet.com/datetimepicker.htm

Here is the demo page link:

http://www.rainforestnet.com/demo_datetimepicker.htm

good luck

Michael Stone
+10  A: 

My best experience with a datepicker is with the prototype-based AnyTime. I know that's not jQuery, but it may still be worth the compromise for you. I know absolutely no prototype, and it's still easy enough to work with.

One caveat I've found: it is not forward compatible on some browsers. That is, it did not work with a newer version of prototype on Chrome.

David Berger
If I could use prototype this wouldn't be a problem, unfortunately we're stuck with jQuery for this app.
fluid_chelsea
Just an update - AnyTime 3 now works with jQuery.
Jaxidian
I haven't thought about this for months and months. But my personal project wanted some updating and I was just about ready to throw in some jquery. I thought I'd replace the datepicker while I'm at it because I didn't need all the features of Any+Time and thought I might as well go all jQuery. And bam! I come across this. Awesome timing.
David Berger
+23  A: 

Timepicker looks promising, especially since it builds on top of jQuery UI. Try the demo.

Here's another Timepicker (same name, maybe same codebase roots). Very similar approach.

jQuery.timepickr is a clever approach and looks like it supports the jQuery UI themes.

Ryan McGeary
Thanks, I looked at the first one before and had some issues implementing it, but it looks like it's pretty actively supported still so I'll try to make this work.Thanks!
fluid_chelsea
The first two projects here no longer exists.
wizard
This one is great! http://addyosmani.com/blog/the-missing-date-time-selector-for-jquery-ui/
tony_le_montana
+2  A: 

I researched this just recently and have yet to find a decent date picker that also includes a decent time picker. What I ended up using was eyecon's awesome DatePicker, with two simple dropdowns for time. I was tempted to use Timepickr.js though, looks like a really nice approach.

deceze
+10  A: 

@David, thanks for the recommendation! @fluid_chelsea, I've just released Any+Time(TM) version 3.x which uses jQuery instead of Prototype and has a much-improved interface, so I hope it now meets your needs:

http://www.ama3.com/anytime/

Any problems, please let me know via the comment link on my website!

Andrew M. Andrews III
Any+Time(TM) version 4.x is now available! The new release supports TIME ZONES (find THAT in any other picker!) as well as jQuery selectors/chaining, easy-removal (avoid memory leaks!) and many other improvements. Please give it a ride, and if you have any problems or suggestions, let me know via the comment page on my website.
Andrew M. Andrews III
Any+Time looks pretty slick. I like it.
Zack Peterson
Just implemented AnyTime in a few minutes on a Rails app. Works perfectly.
Gwyn Morfey
Awesome! Thanks, Gwyn!
Andrew M. Andrews III
A: 

How about this one:

http://razum.si/jQuery-calendar/TimeCalendar.html

Krunal
+3  A: 

Just to add to the info here, The Fluid Project has a nice wiki write-up overviewing a large number of date and/or time pickers here.

Jaxidian
+3  A: 

This one has potential, including ui styles.

http://www.projectcodegen.com/JQueryDateTimePicker.aspx

Daniel
I like this solution, too. Most people don't want to drag, slide or multiclick to get a date entered. My only problem with this script is that my years are 100 years ahead. 2010 dates are being displayed as 2110.
rxgx
A: 

We had trouble finding one that worked the way we wanted it to so I wrote one. I maintain the source and fix bugs as they arise plus provide free support.

http://www.yart.com.au/Resources/Programming/ASP-NET-JQuery-Date-Time-Control.aspx

Petras
+6  A: 

By far the nicest and simplest DateTime picker option is http://trentrichardson.com/examples/timepicker/.

It is an extension of the jQuery UI Datepicker so it will support the same themes as well it works very much the same way, similar syntax, etc. This should be packaged with the jQuery UI imo.

xordon
I've been using this one, and I LOVE it.
Sonny
A: 

i make one function like this :

function getTime()
{
    var date_obj = new Date();
    var date_obj_hours = date_obj.getHours();
    var date_obj_mins = date_obj.getMinutes();
    var date_obj_second = date_obj.getSeconds();

    var date_obj_time = "'"+date_obj_hours+":"+date_obj_mins+":"+date_obj_second+"'";
    return date_obj_time;
}

then i use the jquery ui datepicker like this :

$("#selector").datepicker( "option", "dateFormat", "yy-mm-dd "+getTime()+"" );

so, i get the value like this : 2010-10-31 12:41:57

dhaniBinZain