[patch proposal] custom onKeyUp handler for datepicker

[patch proposal] custom onKeyUp handler for datepicker

Dear jQueryUI team,
Here is a patch that allows the user to specify an additional event
handler in the datepicker. It works as follow :
function parse_keywords(inst) {
var v = inst.input.val();
//do some special stuff, set a new date on inst, _notify it...
}
$(function() {
$(".datepicker").datepicker({
onKeyUp: parse_keywords,
dateFormat: 'yy/mm/dd',
constrainInput: false
});
});
We use it in our software company to recognize special values such as
"+1m" or "-5w": as soon as the user finishes entering "+2d", the date
is automatically converted to "in two days" (today, the result would
be "2009/07/02"). It works similarly for w(eeks), d(ays), m(onths) and
y(ears). This is very convenient, and we believe this patch will
enable other people to customize the datepicker to suit their needs
better. Of course our keywords are very specific so they should stay
outside the datepicker code, which is exactly what this patch enables
us to do.
Best regards,
J. Protzenko