How can I set the current date(today) always selected. dhtmlxCalendar v.3.6
If you mean on loading - calendar selects current date by default.
I mean that the current day always remain highlighted
hi
the following add once on page, make sure calendar.js loaded
dhtmlXCalendarObject.prototype.enableTodayHighlight = function(mode) {
if (mode == true && this._updateCellStyle2 == null) {
this._updateCellStyle2 = this._updateCellStyle;
this._updateCellStyle = function(q, w) {
this._updateCellStyle2.apply(this, arguments);
var t = new Date();
t = new Date(t.getFullYear(), t.getMonth(), t.getDate(), 0, 0, 0, 0);
var r = this.contDates.childNodes[q].childNodes[w];
if (r._date.getTime() == t.getTime() && !r._css_hover) r.className += "_hover";
}
this.setDate(this.getDate());
return;
}
if (mode == false && this._updateCellStyle2 != null) {
this._updateCellStyle = this._updateCellStyle2;
this._updateCellStyle2 = null;
this.setDate(this.getDate());
}
}
enable/disable of highlighting
myCalendar = new dhtmlXCalendarObject("calendarHere");
myCalendar.enableTodayHighlight(true); // or false
OK, Thanks Andrei