ここでは、Trent Richardson の datetimepicker を使用しています。カレンダーで日付を設定するにはどうすればよいですか? 以下は時間を正しく設定しますが、現在の日付として強調表示されている日付は設定されていません。この特定の例では、「今」ボタンのクリックをハイジャックして、現在の UTC 日付/時刻を設定しています。
$.datepicker._gotoToday = function (id) {
var inst = this._getInst($(id)[0]),
$dp = inst.dpDiv;
this._base_gotoToday(id);
var tp_inst = this._get(inst, 'timepicker');
var now = new Date();
var now_utc = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
//
// Time gets set correctly but the date highlight for current day is not getting set in the calendar picker.
this._setTime(inst, now_utc);
$('.ui-datepicker-today', $dp).click();