
Thanks to some readers (Reinout and Jeremy) I’ve posted a couple changes to the Timepicker Addon. It is still early in development but does seem to work pretty well for all of the examples I’ve run it through. Please keep checking back for updates!
Related posts:


11 Responses
Jeremy
04|May|2010The _doKeyPress overrid pasted incorrectly in my last comment, because of less than and greater than symbols. The function should be almost identical to the jquery 1.8 date picker, but on the last line, instead of being char is less than space it should be changed to char is less than or equal to space. I’ll try pasting again and encoding the characters:
$.datepicker._doKeyPress = function(event) {
var inst = $.datepicker._getInst(event.target);
if ($.datepicker._get(inst, ‘constrainInput’)) {
var chars = $.datepicker._possibleChars($.datepicker._get(inst, ‘dateFormat’));
var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);
return event.ctrlKey || (chr <= ‘ ‘ || !chars || chars.indexOf(chr) > -1);
}
}
Jeremy
04|May|2010Another change :)
in the addTimePicker function, after setting regstr I added this:
if (!this.defaults.timeOnly) {
regstr = ‘.+\\s’ + regstr
}
The above snippet should correctly parse any time format after a date because it requires text, then a space, then the time then end of line.
Wendy
05|May|2010This is a great time picker. I want to display the timepicker inline in another popup dialog. I know how to display a datepicker inline by using instead of , but can’t seem to get the timepicker to display inline. Is this possible? If not is there a way I can get it to popup on top of my open dialog?
trent
05|May|2010it should work as inline, but i’ve not tried it. I guess it would take that same option as just the datepicker would. looks like the blog stripped out part of your comment tho
ronald
06|May|2010I want to use this great addon but i have a little problem.
I want to display the timepicker when i click a inputfield. The first time i click in the inputfield it does nothing (firebug places an extra div with noting in it). Only when i click the inputfield for a second time (after clicked somewhere else) the timepicker pops up.
The datepicker DOES work but i only need to set the time..
Does anyone have an idea why?
Thanks!
trent
06|May|2010I’ve not encountered this before. Does your html have any errors? Are you using the latest jQuery and jQuery UI? I did just release a new version. Can you try the old timepicker? heres a link to version 0.1: http://trentrichardson.com/examples/timepicker/js/jquery-ui-timepicker-addon.min.js
ronald
10|May|2010it does not work with that version either. Only the second time you click in the inputfield. If i just use the datepicker there is no problem.
Firebug does not report any errors.
my code:
inputfield:
javascript:
$(this).timepicker({startTime: “02.00″, object.
endTime: new Date(0, 0, 0, 15, 30, 0),
show24Hours: true,
separator: ‘.’,
step: 15});
$(“.time”).timepicker();
});
jQuery version : v1.3.2
jQuery UI version : jquery-ui-1.7.2.custom.min.js
thanks for your reply!
ronald
10|May|2010the code of the inputfield disappeared but it just is a inputfield with ID=time
trent
10|May|2010your example looks like its calling $(‘.time’), if you’re going by id you will need $(‘#time’) ??
Also there is no startTime, endTime, and separator options, which wont break anything but they won’t do anything either… unless you were adding this functionality
trent
10|May|2010i think the blog is chopping out some of your code snipplet, if you still need help just reply and I can email you back instead
ronald
12|May|2010if you want you can email me!
i would like to have your help!
I CAN display the tmeselecter but just after the second time i click in the inputfield..
if i open firebug the following happens:
1) i clich in the inputfield
2) a div is added according to firebug (a div with UI-DATEPICKER,…)
3) i click just anywhere else on the page
4) i click back in the inputfield en now the timepicker appears
Thanks!