我在一个页面上有多个 jquery datetimepickers。尝试在“今天”按钮单击上设置日期,但为页面上的所有日期时间选择器设置以下日期?
如何仅设置具有焦点的那个(使用 Trent Richarsons jquery datetimepicker)?
$.datepicker._gotoToday = function (id) {
var inst = this._getInst($(id)[0]),
$dp = inst.dpDiv;
this._base_gotoToday(id);
var tp_inst = this._get(inst, 'timepicker');
now = new Date();
var now_utc = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
this._setTime(inst, now_utc);
$('.datetime').datepicker('setDate', now_utc); // <- this woks but sets date for all datetimepickers! how to I set for current focus datetimepicker
};