Timepicker
The missing timepicker for jQuery's Datepicker.
I would not recommend you to use this plugin because you may end up hitting your head against the wall. Instead, use the timepicker plugin from Trent Richardson.

I have made this simple timepicker. It is very early release and it is buggy. You can see demo here.
Configuration
It is simple to configure. You only need these 3 options to work correctly (duration, showTime, constrainInput).
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="js/timepicker.js"></script>
<script type="text/javascript">
$(function() {
$('#datetime').datepicker({
duration: '',
showTime: true,
constrainInput: false,
stepMinutes: 1,
stepHours: 1,
altTimeField: '',
time24h: false
});
});
</script>
<input type="text" name="datetime" id="datetime" value="01.06.2009 00:00">
TODO
am/pm- localization
- effects
- dragging
- display inline
Known Issues
- colon in date part breaks timepicker
- duration option must be empty
Change log
- 0.2.1
- fix: datepicker wont close when user selects a date
- 0.2.0
- new: 12h & 24h time
- new: sliders now supports increments
- new: populate an alternate field with time
- fix: incorect parsing time
- 0.1.2
- fix: keep same height as datepicker
- fix: don't reset time when changing months
- fix: leave input field unchanged when not selecting date or time
- 0.1.1
- fix: can't select date when input field is empty and datepicker is closed without selecting date
- 0.1.0
- initial release
Download
Version 0.2.1 - 15.8.2009 timepicker-0.2.1.zip


Hi,
I am using this datetimepicker from last 1 month & i found it reallly good ....but now i have new requirement with date selection...
Requirement is:When user click on textbox for date..if textbox is empty then datetime picker should show system date time i.e time slider should adjusted to system time..(in current scenario it is showing default 12:00 am both min & hr slider at bottom)...
Plz anybody has idea about it let me know...thnx
Hi,
This is a great work Martin.
I have an issue. I am using it in jquery ui Dialog. Initially it was behind the dialog, but by using the solution provided in the above comments, it is sorted out, but still it is not working fine in firfox only (first time i wonder that all things are fine in IE and only ff is giving problem), and when i close the dialog, it is behind the dialog .
I need help for this asap, as my project is on hold due to this issue.
Please any one can help me?
Thanks
Great plugin.
However i noticed it screwed up the design of my site. I use a css design with 100% with header and footer. With this plugin There became a whitespace at the bottom of the site.
For people with same issue here is the fix (this should really always be added even if its not a problem today it can be in future):
timepicker.js ROW 186
this.tpDiv = $('');
THE CHANGE ABOVE IS: position: absolute; so that the div wont mess with existing divs on site.
Best Regards
Adde Lovein
Code dissappeared in above post but basicly just add: position: absolute; in the style attribute.
what can be the reason of only datepicker displaying? showTime is setted in true.
How can I change separator in the date?
I found it. Variable dateformat in the jquery-ui-1.7.2.custom.min.js is responsible for it.
Martin,
This timepicker is simply fantastic and I really want to use it in my project. However, the project appears to be dead. Is this correct?
As there are still a few bugs/omissions I am reluctant to commit to using it in my project. My javascript is not good enough to fix things up myself. In particular I would like to see the text field update without having to click the 'done' button. Also, if I manually type in a new time the change is not kept.
I (and I think many others) would really appreciate it if you would post something to confirm your plans for this timepicker. I fully understand that you are probably very busy and doing stuff for free is never the top priority.
Hi Martin, this extension is really superb! However, I also have same concern as Pawan. Hopefully you could make timepicker a seperate ui component without datepicker. That would be awesome. Thanks a lot... :)
Actually there is it a separate timepicker:
http://milesich.com/tpdemo/tp.html
Awesome date picker, best one when you need to choose date and time! Amazing job! I just have a quick question, is there any way you can specify some sort of valid date range on the settings? Thanks!!
I think I'll be using this for a multi-lingual implementation. Any preferences on how to implement the localization?
Great extension! Any pointer as for how to intergrate this with Jeditable? (http://www.appelsiini.net/projects/jeditable)?
Great plugin many thanks for the work :)
However, I have found a bug.
The time component is being reset if one uses the 'minDate' and 'maxDate' options.
Using jQueryUI 1.8.
Is date formatting supported? Can you add it in the next update if it is not supported?
Doesn't work with blockUI plugin (integrated in a modal dialogue)
Nice Bro. Just what I needed!
Great script! No issues getting it to work with jQuery 1.4
Hey guys,
Trying to trigger an 'onchange' using jquery for the datetime picker input field. I am doing an ajax call to basically insert the date/time into a textarea.
However, it seems that this datetime picker is not being triggered on the onchange. Has anyone come across this issue? have a workaround/solution for it?
Just to clarify, only the date is being returned and inserted but the plugin doesn't trigger the "onchange" for the time.
Same problem here, in an onChange event only the date is present in the input box not the time.
Hi Martin,
That's a great tool!
You talked about a "major rewrite" to include the "second" slider.
Can you tell us when it's coming?
I'm looking forward on that functionality!
Thanks,
Sam
Hi Martin,
Great work!
Just one question, are you thinking to make it available on http://plugins.jquery.com/ ?
Regards,
Sam
Exactly what I was looking for, great work!
One API feature I'm still missing is some sort of "change" event which I can listen for. Currently, when I attach an event handler for the input's "change" event, it get's fired after the datepicker updates the text field, but the timepicker script updates the textbox again to include the time part, after which the "change" event is not raised.
Ahh, I found the piece of code that's responsible for raising the "change" event. The event is raised right after the textbox has been set to the selected date, but after that, the textbox is updated again with the selected time, but this time the "change" event is not being raised.
I'm not quite sure of what's going on in the code, but this seems like a safe way to fix it (at least it works for my case:
(starting from line 127:)
if (input === undefined && showTime) {
if (inst.input) {
inst.input.val(this._formatDate(inst));
if (!showTime)
inst.input.trigger('change'); // fire the change event
}
this._updateAlternate(inst);
if (showTime) {
$.timepicker.update(this._formatDate(inst));
inst.input.trigger('change'); // fire the change event
}
}
Thank you for making this!
I am using jquery 1.4.2 and ui 1.8n.
I had to modify the js file to include z-index for the main div element under Timepicker.prototype ={ init:function(){}.
I am utilizing a jquery ui dialog modal popup to insert events to a calendar and found the timepicker was hiding behind the modal popup.
Fixing the div with a z-index:9999; fixed the issue. this is fyi for anyone, who may be having the same issue.
Hey everyone,
I just realized this date/time picker is not working in IE? Anyone have an idea why?
nevermind guys. fixed it
I'm having a heck of a time getting this to work with IE7 and 8. Any ideas why?
Just tested this one after having trouble with another date/timepicker alike.
It's working beautifully with my custom jQueryUI 1.8 theme and jQuery 1.4.2.
Nice job.
I'm using the ui.datepicker i18n files and I edited your file to match my language.
Thanks for the work, much appreciated.
Nice work! It looks and works great!
Excellent script! I was wondering, how can I limit the selection to only dates previous from the current date? Basically not allowing them to select a future date/time.
Thanks in advance!
Sorry. Disregard please. Guess I need to read more before asking questions.. Total Noob here! Hahaha..
Can I able to use only time picker? and how?
Hi,
I'm pretty new to jQueryUI an love this plugin. I have one question though, I would I go about adding the time to the altField of the date picker rather than in it's own altTimeField?
I need to store the date in: yyyy-mm-dd hh:mm
It'd be nice to be able to get it in the one field to send back to the system.
Any help greatly appreciated.
Many thanks
Richard
Anyone had any luck integrating this with Jquery UI 1.8rc3?
The dialog displays the time picker correctly however after I click "Done" the date portion remains on the screen. Time picker portion disappears as per usual.
Does anyone have any suggestions for this?
I wanted to incorporate their new button/auto complete functions from the UI module however this mod isn't 100% compatible.
Cheers
Hamish
Ok, I'm a idiot, this has been addressed.
Please ignore and thanks Jeff!
You can use the final release of jQueryUI 1.8, it's working great here.
t-mas, I use this code and it means that regardless of how many times you open the dialog the datepicker will open ontop of the dialog:
beforeShow: function()
{
$("#ui-timepicker-div, #ui-datepicker-div").css({zIndex: $(".ui-dialog").css('z-index') + 1});
}
Martin I had to edit the following code:
if (!inst || (input && inst != $.data(input, PROP_NAME))) return; (line 108)
to:
if (!inst || (input && inst != $.data(input, "datepicker"))) return;
This then allows the datepicker to then be closed via the method $.datepicker('hide')
How could I go about setting a minimum and maximum time value, I only want users to be able to choose a time between 8am and 10pm..
You need to alter the code in two places for a quick and dirty fix 1st (Line 26) Add these lines after the comment for alternate field:
'minHours': 0,
'maxHours': 24,
'minMinutes': 0,
'maxMinutes': 59
Then in the show function around line 224 replace
if (60 % stepMinutes != 0) { stepMinutes = 1; }
if (24 % stepHours != 0) { stepHours = 1; }
$('#hourSlider').slider('option', 'max', 24 - stepHours);
$('#hourSlider').slider('option', 'step', stepHours);
$('#minuteSlider').slider('option', 'max', 60 - stepMinutes);
$('#minuteSlider').slider('option', 'step', stepMinutes);
With this:
var maxHours = parseInt($.datepicker._get(inst, 'maxHours'), 10) || 24;
var minHours = parseInt($.datepicker._get(inst, 'minHours'), 10) || 0;
var maxMinutes = parseInt($.datepicker._get(inst, 'maxMinutes'), 10) || 59;
var minMinutes = parseInt($.datepicker._get(inst, 'minMinutes'), 10) || 0;
if ((maxMinutes - minMinutes) % stepMinutes != 0) { stepMinutes = 1; }
if ((maxHours - minHours) % stepHours != 0) { stepHours = 1; }
$('#hourSlider').slider('option', 'max', maxHours - stepHours);
$('#hourSlider').slider('option', 'min', minHours);
$('#hourSlider').slider('option', 'step', stepHours);
$('#minuteSlider').slider('option', 'max', maxMinutes - stepMinutes);
$('#minuteSlider').slider('option', 'min', minMinutes);
$('#minuteSlider').slider('option', 'step', stepMinutes);
Then when you create the datepicker you can set your limits (Note it's currently only in 24hour format):
.datepicker(
{
minHours: 13,
maxHours: 15,
minMinutes: 15,
maxMinutes: 30
})
If this doesn't make sense just contact me
Not sure how hard it would be,, but I would like to take this one step further. If it was a saturday I would like to have a different range of hours. And Sunday I wouldnt want it to be a choice.
Somehow would have to get day of the week
I'm having trouble with showing the date/time picker in a dialog.
the z-index for the picker is 1003 en for the dialog 1000.
if I open the picker a second time it is not in front of the dialog anymore. (the z-index are still like they should be 1000 & 1003).
I do use, 2 date/timepicker, perhaps that gives the error? but I have no idea.
at this point I have tried to fix it with the datepicker beforeShow option:
beforeShow: function(input, inst){
$("#d-project").dialog('option', 'zIndex', 1000);
$(".ui-datepicker, #ui-timepicker-div").css("z-index",1003);
}
Sorry for the repost but this way you should get an E-Mail about it, I use this code to fix the datepicker hiding behind a dialog box:
beforeShow: function()
{
$("#ui-timepicker-div, #ui-datepicker-div").css({zIndex: $(".ui-dialog").css('z-index') + 1});
}
Thank you so much ! worked like a charm :D
Hi, I am using this datepicker plugin in one of my project. It's awesome. I would like to know how can I disable the text box after the selection of the date.
how should i create the start_date and end_date functionality.
means after he select the start date the end date should be greater that start date
I used jqery 1.7.2 before and it worked awesome! now i updated to 1.8rc3 and got the problem, that after hitting the submit button only the timebar disapears and the datepicker is still there and i got no clue how to close it.
any ideas??
Scroll down in the comments for my other post in February for how to fix this.
Hi Martin,
Nice work on your TimePicker! I wanted to let you know about a similar widget I created--I hope you will be impressed by how easy it is to use and customize. Check it out at http://www.ama3.com/anytime and let me know what you think!
Thanks,
Andrew
Hey, I already saw your approach to a Date-Time Picker before, but sincerely I think is a little bit geek or engineer-use only... most of common people could find it just "to complicated" for the normal use of a simple date picker.
Please, take this comment as a constructive criticism.
I work in a company making products for final users, with date and time picker, and after search all over the web, this one from Martin is the best one I found... although it has some issues and limitations, I think is the more friendly approach. Is small, intuitive, and similar to most of desktop calendars.
Again, I like your approach, but the innovation (changin the way of doing some things that people are used to do in other way) sometimes has a price :(
"A person with a new idea is a crank until the idea succeeds!" - Mark Twain.
So, keep trying!
Thanks for the feedback, Cristian! Although I have not done user studies (or know anyone that HAS done user studies in this area), I respectfully disagree that the Any+Time approach is too complicated... on the contrary, I designed the picker to be EASIER than any other picker, and in fact, easier than writing the date and time by hand. As a proof-of-concept, pick a specific date and time and then time how long it takes you (or a pool of guinea pigs!) to write it down on paper. By comparison, see how long it takes you to select that date/time combination using Any+Time, and how long it takes you to select that date/time combination using any other picker... I'd have to see with my own eyes to believe that someone can select a specific date and time faster and with less opportunity for error than by using Any+Time!
Thanks again for the feedback!
Peace,
Andrew
Hi Martin,
Any idea why this ain't working?
thanks
Adi
Hey guys, I´m thinking if it is possible to move the calendar to the right of the input section.
I mean, when you click on the combo (for example) the calendar appears on the right, so the user can pick the date or can view the input and enter the data manually.
This is because I´m having some problems with the possition of the calendar. Sometimes it appears right... but sometimes appears above of the input fields and the user can´t see anything.
Great work
Sad there are no more updates. Thanks to Jeff for the workaround!
Love it. Are you still working on this?
I would love to see a drop down for the time as well.
How can I clear the input field when the page is first loaded or refreshed?
Hi, love this plugin - simple and effective.
I just have one feature that I would like to implement and that is updating the inputbox as the date/time changes, or at the very least when they lose focus.
Too many people seem to miss the "done" button.
Is this currently possible at all?
Hi, awesome timepicker!
However, if I select '@' (unix timestamp) as dateFormat, it includes only date and not time.
Is there a way to disable the buttons when the timepicker is enabled? Ideally when a user clicks off of the control, whatever date / time that is selected should be saved. That seems to be the biggest issue my users are seeing.
I do see in the code where the buttons are forced on when the timepicker is enabled. It's not clear why though.
Also, is this still under active development? It appears it has been 6 months since the last update.
This fine TimePicker seems to be broken with jQuery 1.4.1 and jQuery-ui 1.8 RC. The DatePicker doesn't close when the Done button is clicked. The TimePicker closes, but not the DatePicker.
replace line 82:
if (showTime) $.timepicker.show(input);
with the following:
if (showTime) {
$.timepicker.show(input);
$.datepicker._datepickerShowing = true; // modified/added for ui-1.8.rc2
}
In agreement with Pawan on this exact issue. Can't wait to see a working model.
How do I get a timestamp out of this datepicker?
Regionalisation would be most helpfull...
A simple renaming of the Hour and Minute tag would be most usefull. Something like hourText: 'Hour' and minuteText: 'Minute'.
I've tried changing the script but since I'm no good at it, I didn't get it to work. But it shouldn't be that difficult for someone who knows how to code in jquery...
+++ MY EXAMPLE IN DUTCH +++
$(function() {
$.datepicker.setDefaults({
dateFormat: 'dd/mm/yy',
firstDay: 1,
dayNamesMin: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'],
monthNamesShort: ['Jan','Feb','Mrt','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],
changeMonth: true,
changeYear: true,
duration: '',
showTime: true,
constrainInput: false,
stepMinutes: 5,
stepHours: 1,
minDate: 0,
time24h: true,
hideIfNoPrevNext: true,
showOn: 'button',
buttonText: 'Selecteer',
closeText: 'Sluiten',
currentText: 'Vandaag'
});
$('#startdate').datepicker();
$('#enddate').datepicker();
});
+++ END EXAMPLE +++
PS in Dutch Hour = 'Uur' and Minute = 'Minuten'
I'm sorry, i've get in to the code more deeply, it looks like the problem is my own.
Hi, Martin. This is a nice feature that just I want to try.
But I have an error trying to use timepicker:
"dt is undefined" in timepicker.js line 359 (this._colonPos = dt.search(':');)
I'am new to jquery and my question may be a stupid one. What does "dt" mean here?
Martin, this is a fantastic piece of code. Serves all my needs perfectly. However, I have one query:
I'm initializing the datepicker like so:
$('input[name=datetime]').datepicker({arguments})
This is for an array of textfields that share the same name. It works flawlessly when the fields are pre-loaded.
However, if the textfield is cloned dynamically (using clone() method) the datepicker does not trigger. Any idea why?
Best Regards,
~Sabier
Hi,
With jQuery 1.4, I am getting an error where the time picker is overlapped with the date picker. Once you select a time then it snaps over to the right. Can you fix this?
Thanks for your work on this, it is pretty slick.
I was getting this same problem. Try setting option showAdmin to '' . It worked for me.
$('#xxxxxx').datepicker({
showTime: true,
constrainInput: false,
stepMinutes: 1,
stepHours: 1,
altTimeField: '',
time24h: false,
showAnim:''
});
is there a setting for minimum date || maximum date?
and can I make the textbox/input box, readonly
Set the "readonly" attribute on your input.
This is the most promising date picker control I've seen so far. I've been using the stock jQuery one which is quite good but doesn't have the time picker built it. Yours has the time picker, looks good and seems to follow the practices that the stock jQuery components follow - I haven't seen one single date picker that had those 3 criteria until now. Great work!
Im so sorry. I wasn't clear enough. I meant I got the "?" symbol on EMPTY table cells. Its as if the server app fills in the symbol on NULL cells so perhaps I need to set something I really don't know. I used a different Cal and so did not have this issue so I know its this Cal :)
Ok first all all I totally dig this calendar and timepicker combo so I thank u 4 ur efforts very much. However, I did had make some modifications to the code get it working exactly like I wanted and THE only issue I have that I can't seem to fix. Is that I get this weird little "?" symbol when I try to implement the datepicker in a coldfusion or asp type page. Its the only issue I have w/t it n its troubling because I don't know how to get around this issue. Its as if the Calendar was only made 4 "html" pages and not a dynamic page which really makes no sense seeing as how you would only use it on a processing page. I just wanted to know if there's a fix for this issue. Tha weird little "?" symbol :) thank u. I really was testing it out tho. Customizing it n all that good stuff. Its a awesome cal tho.
How can I change the size of the timepicker? I really like the default size of datepicker.
http://jqueryui.com/demos/datepicker/#default
As I found elsewhere you can put that in your css :
.ui-datepicker {
font-size:66%; /*the size you want*/
}
but pay attention to .ui-widget rule in jquery-ui.css, it can interferes.
Hi,
I have just made a useful amendment to the code with this override :
It will set the current time when 'today' is clicked and also select current day (jQuery UI Datepicker does not do this)
/**
* Override the _gotoToday function
*/
$.datepicker._gotoTodayOverride = $.datepicker._gotoToday;
$.datepicker._gotoToday = function (id) {
var target = $(id);
var inst = this._getInst(target[0]);
var date = new Date();
inst.tdDay = date.getDate();
inst.tdMonth = date.getMonth();
inst.tdYear = date.getFullYear();
this._selectDay('#'+inst.id,inst.tdYear,inst.tdMonth,inst.tdDay);
$.datepicker._gotoTodayOverride(id);
$.timepicker._setTime('hour',date.getHours());
$.timepicker._setTime('minute',date.getMinutes());
};
Hi,
Thank you for this awesome addition. I'm using it on my new application.
hello... I'm trying to use this, but my elements IDs have a semicolumn (:) on it, like: id="form1:check_name". I think its causing the problem... Have any ideas?
[]s
Humberto
Great job!
Is there a way to update the value of the input when the user clicks on day or changes the hour/minute value?
It looks like timepicker is broken with last release of jquery (1.4.1) and jquery-ui (1.8.1) :-(
Martin,
Without a doubt, this is some incredible work. If I ever get into a jQuery pickle and have client cash, I'm coming to you for my business.
Props on the calendar, best one I've found.
My only problem was that I found it rather hard to hide this calendar (or choose when it was shown). I wanted to initiate it on the click of an icon rather than the focus of the input field (actually I wanted it to never show up on the input field focus).
My Code:
#calendarIntakeDate is the ID set on the image icon.
#IntakeDate is the ID of the input field.
--------------------------------------
$('#calendarIntakeDate').click( function(){
$('#IntakeDate').datepicker({
duration: '',
showTime: true,
constrainInput: false,
stepMinutes: 1,
stepHours: 1,
altTimeField: '',
time24h: true
}).focus();
});
$('#IntakeDate').click( function(){
$('#ui-datepicker-div').hide();
$('#ui-timepicker-div').hide();
});
--------------------------------------
That was my work-around (like jd said below), perhaps maybe I'm oblivious to something?
Also, this works really well with the JQuery mask and watermark plugins as I have the field as:
$("#IntakeDate").mask("99/99/9999 99:99",{placeholder:"_"}).Watermark("mm/dd/yyyy hh:mm","#369");
Hope this helps someone, but maybe I missed some sort of hide/callback.
I Martin - this is a really nice piece of work, I'm definitely going to be using this on a project in the near future.
Is there any change that you get this working with JQuery 1.4
At present, there are some formatting problems which makes the time-picker section hide behind the date-picker section.
Thans
Rick.
sometimes you do things like this
this._orgValue = $('#' + this._inputId).val();
when id has '[' and ']' fe test[10] you have a problem and timepicker wont show up
imho
this._orgValue = $('input[id=' + this._inputId + ']').val();
is much safer
It's can not use with jquery1.4
Martin - AWESOME jQuery plugin! Thanks so much! Just one problem. I am also using the Scriptaculous function to show a page overlay, then overlay a DIV. It's an HTML form on this DIV that I need to call your Date/Timepicker from, but it always gets called up UNDERNEATH the DIV. It's hidden, until I close the div, but then it's useless.
I tried something like:
$(#Timepicker).css( 'zIndex', 6000 );
but that didn't work. I am very new to jQuery.
Any help you can give on how to make the Date/Time picker show on top of everything else would be great! (by the way, I did try editing the inline CSS calls in timepicker.js, but nothing I do helps.)
Thank you Martin!
-Mark
I'm having some issues with being able to select the lowest possible value for hours and minutes. (It will only go down to 01:01am and not 12:00am). Any ideas?
Martin.This is a great Plugin. Thanks for spending the time on it.
I am trying to use the with dynamic table rows. I can get the first table row date input working, however as more are added, timepicker is not applied to them.
The code I am using is:
$('input.dateInput').live('click', function() {
$(this).datepicker({
duration: '',
showOn:'focus'
});
}).focus();
Thanks for the timepicker.
Multiple timepickers on one page seems to work fine for me, except that in my altTimeField, I get concatenated data depending on the number of timepickers on the page. So if I have 3 timepickers and select 12:45, my altTimeField shows 121212:454545.
I fixed this by altering the first few lines of the update function:
update: function (fd)
{
var curTime = $('#' + this._mainDivId + ' span.fragHours:first').text()
+ ':'
+ $('#' + this._mainDivId + ' span.fragMinutes:first').text();
It seems to work. (although I doubt if this is the best way to solve this problem).
hi,Martin,
when the input id contain a colon(:) ,it seems that the time picker is not working. any solutions?
Thanks!
Code list:
$(function() {
$('#jobtableformID\\:startTimeFrom').datepicker({
duration: '',
showTime: true,
constrainInput: true,
dateFormat: 'yy-mm-dd',
time24h: true
});
});
It looks as though you can only have one date time picker on each page (as it uses the id). It would be nice if it could use the class instead of the id to find all possible datetime inputs. This would allow you to have like "from to " or whatever.
thanks for this by the way. It's awesome.
Hi, Martin,
Is the datetime picker localized?
Thanks
this fixes the colon bug:
in _parseTime() instead of using the _colonPos stuff, I replaced it with this:
var arr = dt.match(/(\d\d):(\d\d) (\w\w)/);
if (arr) {
h = parseInt(arr[1], 10);
m = parseInt(arr[2], 10);
a = arr[3];
}
Waiting for you timepicker separating from the datepicker functionality.
Great plugin!! Solves a big problem for me if i can get it working fully.
I need to get the value that the user has selected when they pick a date and time. I am currently using this to test detecting a change to the datepicker field (id = timefield):
$("#timefield').change( function() {
var datetime = $("#timefield").val();
alert(datetime);
});
Only the date, and not the time is returned. Can anyone see what might be going wrong?
I had to give up finding a neat solution. I am using this workaround - split the check into two functions, one to get the change, and another to check the value of the field a few milliseconds afterwards.
$("#timefield").change( function() {
setTimeout("updatetime()",100);
});
function updatetime(){
var datetime = $("#timefield").val();
alert(datetime);
}
Perhaps that is helpful for others - although if anyone has a "correct" method of doing this please let us know!
I have had to make a work around, splitting it into two functions. One to catch the change, and another to check the field value a few milliseconds afterwards.
$("#timefiled").change( function(){
setTimeout("updatetime()",100);
});
function updatetime(){
var datetime = $("#timefield").val();
alert(datetime);
}
This method might be useful for others having the same issue - but if anyone knows the "correct" way to get around this, please let us know!
Hi, I have recently added this timepicker to one of my website (not live atm) and I am using this on the user registration form to select a date of birth, so obviously I have set 'changeMonth' and 'changeYear' to true, where would/could I set how many years to show backwards, the default seems to be 10, and how many years forward, seems to be 10 aswell. I would like to set it to go 100 years back and 0 forward. for example, from 1909 to 2009. Where will I do that?
okay nevermind, sorry, I was being a dumbass, there is a setting 'yearRange' and I just set it to '-100:0'. For anyone else not knowing what all the possible settings are, just click on this link and click on 'Options': http://jqueryui.com/demos/datepicker/#dropdown-month-year
Looks like promising picker, but what's with color gradient on scroll bars. Looks like smooth transient, and than about 10% from top it turns in solid color.
Is there a public source repository? I'd like to fix a bug; _generateHtml() is called in init() which means the html is added dynamically to every page that includes the js file. I think it should not add the html until show().
very nice - thanks for doing this!
one suggestion - I have a function triggered by onClose that takes a split second to run. After clicking "done", the datepicker portion of the widget disappears immediately (as I would expect) however, the timepicker portion remains visible until the onClose function finishes.
my current (ugly) workaround is to add:
$('#ui-timepicker-div').hide();
at the beginning of my onClose function. It would be nice to have the timepicker disappear with the datepicker if that's possible. Any suggestions for a better workaround in the meantime?
thanks!
I think your Timepicker U.I might be improved slightly if there were quarter hour (and/or ten minute) increments listed beside the minute slider so users could quickly select a precise time.
Also having the timepicker being able to be restricted to certain hours (the working hours of a business perhaps) with each hour marked for quick selection if the total number of hours were small enough to fit might be nice.
please continue with this project to make it stable!
a "clear" button would also be nice
as you cant edit the input field - but if you dont want a date anymore...
any ideas on how to implement this?
You can set the other jQuery options to display an image to click instead of the text field. This then give you the option to erase the date.
$(function() {
$("#datepicker").datepicker({showOn: 'button', buttonImage: 'images/calendar.gif', buttonImageOnly: true});
});
i wanted to impliment your datetime picker
as i need the following functionality (which i could not find anywhere else):
just date
datetime
just time
but i spotted several bugs
the most important: in chrome (and possibly other browsers) datetime is not working! it only gets the date and puts the date back into the datetime field
additionally, if you use
dateFormat: \'yy-mm-dd HH:mm\',
the HH:mm is not translated (the rest is, though!)
seems like this is attached afterwards
but as i said before, not working in some browsers
so the "whole" dateFormat option might be more straightforward.
is there a way to easily work with a hidden date(time) "input" and 1-2 visible areas or inputs that serve as display in a "nice" format?
i tried it with "altField" and "altTimeField"
but they would not have a "onclick" selector
and i cannot use oder - i am forced to use an input i guess
If possible, it would be great if the time picker sliders were horizontal and below the date part.
If not, then I think they should start the other way up.
Ah I'm getting this error in Firefox:
"$('#datepicker').datepicker is not a function"
Hmmm. I implemented this into my site but nothing happens when I click the text box. Did I forget something silly?
based on the following site i was able to resolve my issue.
http://www.andrewrowland.com/article/display/ui-datepicker-dotnot-validator-problem
thanks
oh i see, my issue is "length is null or not an object". encountered this in IE. works properly in FireFox. How can i solve this problem.
Thanks,
Great, it is cool. However, it is not working properly date field only. It doesn't close the calender when you select a date or click the done button. what can be the problem? I'm trying to use it because I've one field in the form that needs date and time, while the others are just date field.
Thanks,
Yeah, I agree with the majority it would seem. Nailed a much needed feature but unfortunately bound it to another core component.
I would love to see this as a stand alome time picker plugin, think about it, if you managed to put it together and it got enough interest you might get offered to have it added to the core UI library.
I wonder if anyone can help me with this?
I have two datetime pickers on a page and when they select a date/time from the first, I would like to automatically change the second value to that of the first plus one year?
Is this possible? If so, can anyone point out how?
Thanks
The jQuery UI datepicker allows for an "onClose" callback which passes the value in the datepicker field to the function:
onClose:function(dateText,dpInstance)
{
var dt = new Date(dateText);
//do some date manipulation
$('#different_field').val(dt);
}
I just tried this, but I'm getting two issues - the first is that the date format is different from the date format of the original box. The second is that when I change the date format in the first box, i.e., to yy-mm-dd, then I get an error of "Invalid Date." How would I make the second box recognize the date on the first and then print it correctly?
hi
why you overwrite original datepicker ?
why you dont respect jquery plugin codex ?
original options doesn't seems to work via your function
I have overrided some of the original methods. The DatePicker should work as expected. If not I will fix that.
I have a bunch of datepickers already all over my site, I wanted the time part to go with 2 of them. Now on the calendars I have inline, I get a js error for this.tpDiv not defined, is there a way to fix it for those calls?
Hi Martin,
First of all, I want to thank you for this great tool. I have a request for you: I want to can use this time format HH:ii:ss for time picker, in order to can introduce directlly in a mysql db. Can you tell me how to change this?
Thanks s lot!
You can not tell timepicker to add seconds to the input field. However you can add seconds part your self on the server side. In PHP: $dt = $_POST['datetime'] . ':00';
Bug:
Using the node.value function in the DOM returns only the date.
Change Submission:
Hello Martin, can you please consider the following change to your code to solve this problem.
See function: _hideDatePicker() in version 0.2.1, I moved the following line:
inst.input.trigger('change'); // fire the change event
from line 117 to directly after line 122.
I haven't added good checks etc and I think you will be the best person to see how to do this.
Thanks.
Here is a snippet of the code:
if (input === undefined && showTime) {
if (inst.input) {
inst.input.val(this._formatDate(inst));
// moved from here
}
this._updateAlternate(inst);
if (showTime) $.timepicker.update(this._formatDate(inst));
// moved this
inst.input.trigger('change'); // fire the change event
}
Firstly I thank you for providing such a great DateTimePicker.
I am using the DateTimePicker as an inline option in a JQGRID form edit. I am trying to get the date and time selected on a CHANGE type (jquery), however i am only getting the date value but not the time value.
I don't know if it is a bug or if it is supposed to work that way, but i would really appreciate your help if you could provide a solution for this.
thanks and regards
vamsikrishna kamireddy
That is probably a bug. I should release a new bugfix version.
Suggestion:
When a date is selected the field should be updated. Similarly, as the time is changed using the slider, then the time must be updated in the field and not have a separate time keeper.
Obviously, pressing Escape or closing, without Done should restore the original value in the field.
I do not really like your suggestion and I think it is good as it is because a user can see old and new date and time together.
Suggestion:
When "Today" (i.e. the current button) is pressed then the time should also be set to now and not just the date.
Great suggestion, thank you!
Hello,
How do I open the picker of years & months ?
It likes your demo image.
Thanks.
Check this link to see how:
http://jqueryui.com/demos/datepicker/#dropdown-month-year
Thank you very much :)
How to trigger it when user click on a link?
I got it, there is an option we can put in it.
Can you share how you have an option to enable timepicker with a click?
Hi!
Thanks alot for a great plugin! :) It worked great in Firefox from the start, but I had som issues with IE 8. I got 'length' is null or not an object when I clicked done (vals.length was called). I ended up removing the line that fires the change event in the _hideDatePicker function, and then it all worked fine both in IE 8 and in firefox.
Thank you for the info, Lise! I have tested it only on browser which I have on my computer and there is no IE 8. With next releases I will be tested the timepicker on all major browsers. I promise :)
Great plugin! I will try it out for sure. Just one more question, Does this plugin support minHour and maxHour, meaning, to limit inputs to a certain time period? Thanks!
No, it does not support minHour and maxHour but it sounds like a good feature so I will be thinking about it. Thank you!
Hi,
Thanks for a good DateTime picker. Its really nice. Mean while I want a small change in it. You can reproduce:
Shall we display time under date not in slider right side
just as
"Here our datepicker" after this
"Time 12:00 AM"
Thanks
Trushal
Thank you for your great work!
But how can I set slider value to "now" time?
sorry, I find I don't express the problem clearly. I mean when the datepicker show for the first time the silders' default value is set "now" time.
kergee, timepicker does not have an option to set the default time but a possible solution would be to fill the input field with the curent date and time so timepicker will show the current time
Great script. This is something I was looking for long time :) thank you.
Whoops, sorry, I posted before I'd seen the stand-alone time picker. Very cool, and Thank You!
Would it be possible to configure this so it shows only the hours and minutes?? I'd love to use this as a time-picker, but I don't need the date-picker part. Is this possible?
Thank you! I'm looking forward to localization feature.
Martin,
This is easily the best timepicker plugin I have found a plan to use it in my app! Thanks for developing this. I do have one question (of course). I have a number of datepickers wired to input boxes that work correctly, but I do have a datepicker assigned to a as an in-line display on the page (e.g. the calendar is always visible) and I haven't been able to get the time sliders to appear with it. Is this supported? Or am I missing something?
Thanks again!
Hi John, in-line display is not supported right now but I will add it to my to do list.
Martin,
Great plugin! I'm using it and just having one problem - I have it popping up automatically when user clicks on a text box, however when the user just chooses to type into the text box instead of setting the date via the picker then they can enter the date and time, hit enter and tab away to another text box however the datepicker is still visible on the screen. Is this intentional?
Thanks,
Jo
Hello Martin, I tested your datetime picker and for the showTime: true parameter it works smooth. For the showTime: false the today field is missing.
Thank you
Great one !
I'm using this in Oracle APEX
THX for your work !
Best regards
Piotr
A great plugin indeed. :)
I'm looking for a separate time picker control.
This is an excellent piece of work. I was able to replace one of the control without any trouble at all.
One small comment I have is that you may want to check out when you run the control in IE 8. The height for time slider is not the same as datepicker.
Is there a license available for this? If so, which?
It should have the same license as jQuery UI components so
Dual licensed under the MIT and GPL licenses.
hi Martin,
Great work, I will definitely use it in my project. I also hope it can support second as an optional selection.
Hi Martin,
This is wonderful, although you need to update the demo page (it's still running on 0.2.0).
I'd like to suggest that you don't make the minute slider work on 15 minute (or any) increments, but rather provide clickable labels for increments, so that way users can still choose to have odd times as well.
I'd also like it if you did go ahead with options for default time and forcing the user to select a time. Those would make this _incredibly_ useful for me.
Thank you! It is fixed now.
Clickable labels could be a great enhancement but It won't be easy to implement.
Hey Martin,
Turns out I'm just an idiot and spelled 'duration' wrong so it wasn't picking up as being there.
Oops.
Great work on the plugin though, I'm really liking it!
Great tool!
I found a small bug though. The change event is not triggered when the time is added.
I've added the following line to line 250 to fix this:
$('#' + this._inputId).trigger('change');
Thank you, Michel. I will fix that in next release.
Thanks to Martin for this great piece of code and thanks to Michel for the fix. I was wondering why nothing happens on change in my datepicker events ;-) Fix works perfectly for me...
this is a great tool and very easy to implement.
is there a way for you to update the textbox when you change the date time, even thought you dont want to close the popup?
No, this is not possible. Do you know any example where you need this?
Thanks so much for this it works great.
I have two questions. Is it possible to set a default time if a user does not select one. Right now if a user does not select a time in the datetimepicker it comes up as 00:00 is there a way to have it be 17:00 default. Also is it possible to have the function tack on a :00 to the end of the time selected so it fits the .
Thanks
Hi Justin,
It is not possible right now. Few people here wants force the user to select time so maybe I can make an option to set a default time or force user to select time.
I am sorry I don't understand the thing about function tack.
Martin
Sorry, one more thing. When the dialog is shown the timepicker is already open on the first textbox rather than waiting for a click to open it. It behaves normally when the containing div is not instantiated as a dialog.
Thanks again.
Thanks for this, it works superbly.
Is there anyway of setting the z-index of the datepicker? I'm trying to use it in a JQuery UI Dialog and it's appearing underneath the dialog div. (I've had to set the z-index of the dialog quite high to prevent the Telerik menu control from appearing above that)
in your css, add a rule:
.ui-datepicker, #ui-timepicker-div { z-index:1003; }
Should take care of the overlapping issue
I'm having trouble with showing the date/time picker in a dialog.
the z-index for the picker is 1003 en for the dialog 1000.
if I open the picker a second time it is not in front of the dialog anymore. (the z-index are still like they should be 1000 & 1003).
I do use, 2 date/timepicker, perhaps that gives the error? but I have no idea.
at this point I have tried to fix it with the datepicker beforeShow option:
beforeShow: function(input, inst){
$("#d-project").dialog('option', 'zIndex', 1000);
$(".ui-datepicker, #ui-timepicker-div").css("z-index",1003);
}
I'm sorry for posting 3 times in a row, but I thought of something else:
I already wrote my own code for a callback function to take care of this, so it is possible without your help. However, I think people would find it useful...
My database app needs to receive time in military (24h) format -- but I don't want my users to have to think about military time when entering it in. Therefore, it would be good to have a 24h setting for what the users sees separately from what the picker puts in the form field.
For example:
interface24h: true/false -- appears as 24h time to user
time24h: true/false -- stored in db field as 24h time
Whoops, of course I meant William's suggestion....
To answer your question: Yes, checking if users have clicked or moved the sliders would do it!
Thanks so much for putting this together - it's awesome! Just 2 questions:
1) I'd love if you could implement Martin Milesich's suggestion of allowing us to force a user to select a time.
2) The sliders may not be intuitive to all users, so I would really like it if there were an equivalent of the existing DatePicker's changeMonth: and changeYear: options -- but for changeHour: and changeMinutes: -- allowing dropdowns for your time component just like they exist for the calendar component. Is this something you feel you might implement sometime?
This is an excellent addition to the datepicker, easily the best one out there.
The one thing to make this perfect for me, is to not close on date selection, and also to force a time selection rather than defaulting to 12:00.
I am looking forward to the next release.
Hi William,
How can I force user to select a time?
I can check if user has moved with the sliders handlers but 12:00 is a valid time.
Martin
Hi Martin,
I have small feature request.
When I want to select a date and a time I have to select the time first and then the date, because after selecting a date the datetimepicker closes. For the LTR-people the date is the first they have to select.
Could you make it possible that when the buttonbar is visible, the date-selection doesn't close the datetimepicker and only the button Done does that?
Drop me a note if you don't understand the question, it to early in the morning to explain it in few words.
Jochen
Hey, thanks for the great plugin!
I'm trying to implement this on a site with a fair bit of CSS and JS and am having a few issues.
On initial display of the calendar the time sliders are rendering over top of the calendar, but once the time is changed they display properly to the right of the calendar.
And the sliders for time work, but the handles only ever display at the top of the slider, they don't move, only the fill value changes.
Do you have any ideas where I should look to try and sort out these issues? I looked through the CSS and there didn't seem to be any conflicting CSS trying to override what was already displayed.
Hi Chelsea,
Do you have any working demo where I can see that? Because I can't help you with just your explantation.
Martin
Nah, I commented a bit to quickly. The above works because inst.show throws an error, preventing the hiding. Instead, we need to override the _selectDate method, removing the call to _hideDatepicker altogether. Works fine.
With the help of some pointers from smart people on stackoverflow I found that this is all you need:
onSelect: function(dateText, inst){
inst.show();
}
I believe this should be added to your default example above.
Great! Thank you very much!!!
Seriously, this is one of the few jQuery plugin I've seen that just works as it should, without me having to trickle around with it. Given all the "event sites" out there, I'm surprised this kind of widget haven't shown up earlier, but I guess it takes some skill to execute it right. Well done!
I have one question: When the user selects a date, the widget closes, and they have to open it again to select the time. I would like to keep the widget open when they click the date, and instead only close the wigdet when users click "Done". Do you know a way to do this?
I suspect this is a datepicker onHide function override or something, but it feel essential to getting the timepicker to work well together with the datepicker, so if I were you I would consider adding the nessesary configuration options for that to the usage snippet at the top of this page.
Again, thanks for your great work!
Hi Emil,
I have a working version that does not close when a date is selected and I will be releasing it soon.
Martin
Looking forward to it!
I'm having the worst time getting the time part of things to appear. showTime is true and I'm using all the exact same scripts. Is there something else that regulates it's display?
I'm loving the way you're implementing this idea, I'm looking forward to a stable version!
I do have one suggestion though, I'd recommend to not hide the timepicker component when a date is selected. Since the date is on the left side, people probably will start with the date, which means they'll have to reopen the picker again for the time.
I am working on new version which will fix some bugs and add increments to sliders. Maybe it will have support for am/pm. It depends how much time I will have. Expected release is next week.
Hello!
Nice plugin!
Does it support increments? Like: 5min, 10min! 1min increment it's not REALLY useful for most people.
I just implemented this into a site, works like a charm. Thanks very much. I'll have to remember to check back to see if it changes from 24 hour click to AM/PM!
Hi, great work just what I was looking for...
It's working fine on one page however on another I get the following error
Safari OS X: RangeError: Maximum call stack size exceeded.
FF OS X: too much recursion
In both cases the problem seems to be on line 23: $.datepicker._showDatepickerOverload(input);
Any ideas what could be causing this? I have removed all other js from the page
I will take a look for that.
Hello,
this is the first date-time picker ever that finally includes 1 minute intervals, all the others I've seen had 15-min intervals! So, great work!
Two requests though:
1- Will we be able to select year (and month) from a drop-down selector (like in the screenshot?)
2- Can I redirect time to a different form field?
Regards,
Guvenc
Yeah, I know! I hate when I am limited by design. They assume that 15-min intervals are enought for everyone. WRONG.
1- Its datepicker feature. check jqueryui docs.
2- Not right now, maybe in the future.
This is perfect! Thanks, you just saved me a lot of time and provided a solution more elegant than i would have come up with! Please let me know when you have snap-able sliders added.
Hi,
is there support for adding seconds to the input?
Slider for seconds will not be in this component as it is. But I am going to do a major rewrite so any feedback is welcomed.
Hi Martin, great work! Are you planning to - from Chuck - "remove the minutes slider and have the hours slider snap to 15 minute increments. Plus, you might want to have it start at the top instead of the bottom."
If you do it would work great for me. I need a really simple way for kids to schedule group chats.
Thanks,
Christian
Hi Christian,
actually I don't plan to remove the minutes slider. I have plan to make sliders snap-able with config option for increments separately for each slider.
Why do you guys what to have it start at the top? Because where I live every slider starts at the bottom to the top or from the left to the right.
Martin
Thank you for the work on this. It looks very promising. I agree with some others that I would prefer for the time slider to start at the top with AM, but I'm sure this is just a cultural difference. If it were a slider representing a min/max type selection like 0-100, it would make sense to start from the bottom, almost like a bar graph. However, time is start/end and my users don't visualize it like a bar graph. Instead, start and end works the same way that their eyes move down a page, which is in a downward direction. I understand if your user base is used to an opposite convention. It might be nice to include an option to flip the direction of the slider and to put the AM at the top. Just a thought.
Regardless of cultural differences, I would argue that your blog comments run backward and are frustrating to read through.:)
Thanks so much for this. Worked like a charm :)
Is it possible to show only the timepicker without the datepicker?
Thank you for the fix. I will put it in my next release.
Right now you can't show only timepicker but I am working on a standalone timepicker. I will anounce it when ready.
I found the solution to the problem that I've just mentioned. The problem was that parseInt interpreted the 01 - 09 values as octal. That's why 09 was parsed as 0. The solution is this.
In the _parseTime function change to this:
if (this._colonPos != -1) {
h = parseInt(dt.substr(this._colonPos - 2, 2),10);
m = parseInt(dt.substr(this._colonPos + 1, 2),10);
}
Again, thank you very much for this great extension!
Hello! Great plugin! Thank you very much!
I think that I found a bug, when I insert the hour 09. The slider does not follow the value of 09!
Thank you very much!
ok so i've worked out i can pass a class instead of a div on the call for the datepicker, however when i do this i get inst is undefined.
$(function() {
$('.datestart_shd').datepicker({
duration: '',
dateFormat: 'yy-mm-dd',
showTime: true,
constrainInput: false
});
Hi ive put the class="hasDatepicker" now the dayepicker doesn't show at all!, i dont see a hasDatepicker class anywhwere in the timepicker/css/ui-lightness/jquery-ui-1.7.2.custom.css file?
am i missing something?
Sorry, I was wrong with that and I have no idea why it is not working. I saw you have lots of javascript code on the site. Maybe it interfere with some other code on your site.
Hi Martin !
Very good component, easy to use. One comment to help you improve it, on a blank field, when you enter in the field, the datepicker is displayed, then, if you do nothing, just click outside the picker, the field is set with the default picker date. I think it should let the field unchanged has the user clicked out of the datepicker.
Cimballi
This is fixed in v0.1.2.
Hoi nice little plugin :)
am having a few problems getting the time picker to display.
I have a page with the following which works fine no problems:
$(function() {
$('#datestart_shd').datepicker({
duration: '',
dateFormat: 'yy-mm-dd',
showTime: true,
constrainInput: false
});
$('#dateend_shd').datepicker({
duration: '',
dateFormat: 'yy-mm-dd',
showTime: true,
constrainInput: false
});
});
body{ font: 80% "Trebuchet MS", sans-serif; margin: 50px;}
.ui-datepicker td div a {padding: 0}
<input name="id_vnu" type="hidden" id="id_vnu" value="" />
<input name="id_shw" type="hidden" id="id_shw" value="" />
Start date and time
end date and time
problem i am having is if i copy the code and put the date picker inside a container div i have it doesn't show.
I'm a bit rubbish with css and dont know what i need to change to get the timepicker to display whn its inside the div.
$(function() {
$('#datestart_shd').datepicker({
duration: '',
dateFormat: 'yy-mm-dd',
showTime: true,
constrainInput: false
});
$('#dateend_shd').datepicker({
duration: '',
dateFormat: 'yy-mm-dd',
showTime: true,
constrainInput: false
});
});
body{ font: 80% "Trebuchet MS", sans-serif; margin: 50px;}
.ui-datepicker td div a {padding: 0}
<input name="id_vnu" type="hidden" id="id_vnu" value="" />
<input name="id_shw" type="hidden" id="id_shw" value="" />
Start date and time
end date and time
can anyone help me please???
http://www.freecomedy.co.uk/cp/shows/show_dates_add_inc.php
that one works
http://www.freecomedy.co.uk/cp/shows/show_dates.php
that one dont???? can someone have look in firebug or something and giove me some pointers your hewlp is much appreciated
Martin,
I tried the following code to use jQuery in ASP.NET GridView. But doesn't work.
$(document).ready(function()
{
$('.txtDate').each(function ()
{
$(this).attachDatepicker();
});
});
<asp:Label ID="lbl" runat="server" Text='' />
I love this idea. One small UI suggestion that I have would be to remove the minutes slider and have the hours slider snap to 15 minute increments. Plus, you might want to have it start at the top instead of the bottom. Just my two cents as a UI guy.
Great work!
I don't like the idea with only on slider and 15 minute increments. I must be very confusing and I don't like timepickers where the minute intervals are so restrictive.
Hi,
I've worked on that time picker too.
See here:
http://blog.w3visions.com/2009/04/date-time-picker-with-jquery-ui-datepicker/
YOu could take the am/pm for your work for example..
Let me here from you..
dan
Hi dan,
I know your site and timepicker but I don't really like your implementation. You are displaying datepicker inline on you own popup with sliders and thats changing datapicker's behavior and that I don't want. So I has started my own implementation.
Martin
Thanks Martin, now it makes sense that Date and Time appears. Do you have more custom CSS like Redmond, Start, Black etc?
I am not using custom CSS. It is exactly the same as you can download from jQuery's UI site.
Martin
thank you for this wonderful component; the idea with the sliders is very good;
i have a question: how can a specify the format of the resulting date-time ?
i want to use the value in a sql insert statement where i expect a datetime value and this is not valid;
thank you
Thank you, but the idea with the sliders is not my. The original idea is from Lovemore's World: An effective jQuery Date Time picker.
Check the jQuery UI Datepicker documentation for dateFormat option to specify date format. The time format will always be HH:ii.
If you want to use the value in sql dateFormat should be 'yyyy-mm-dd'.
Martin
Hi,
Thanks for a good DateTime picker. Its really nice. Mean while I found a small bug in it. You can reproduce:
1. Assign a TextBox to the jQuery datepicker.
2. Click on the TextBox.
3. Do not select any date or time.
4. Click on any part of the screen.
5. Textbox is filled with 00:00
6. Now open the calendar and click on any date. It won't add the date.
Please let me know if this bug is fixed.
Thanks Again,
Achutha Krishnan Bathey Raghunath
Hi Achutha,
Thank you for your report. The bug is fixed in v0.1.1.
Martin
This is really a good extension of what we have for JQuery datePicker. This combines TimePicker with a Date. But What I had been facing of late that I just need to have TimePicker where Date is not relevant. Would it be easy to just show the time picker option without date..
Thanks
Hi Pawan.
Thank you! Unfortunately in this version I cannot separate timepicker from datepicker because timepicker is tightly bind to datepicker. I have plans to make this timepicker as a separate ui component without the need of datepicker.
Martin
[...] Martin Milesich’s DateTime Picker: Our Approach This is a kind of “Our Approach” of Martin Milesich’s DateTime Picker. [...]
[...] Martin Milesich’s DateTime Picker: Our Approach This is a kind of “Our Approach” of Martin Milesich’s DateTime Picker. [...]
[...] Tags: datetime, javascript, jquery, picker Ecco un buon widget ( datetime picker) per jQuery: http://milesich.com/timepicker/ Lascia un [...]