Board Logo

disable older dates
jvcoppen - 9/9/2010 at 12:01 PM

My solution to disable older dates

regards,
jvcoppen.


in html page call add older_than_disabled:
new tcal ({'controlname':'idname','older_than_disabled':'14-09-2010'});

in calendar.css add (after div#tcal td.selected):
div#tcal td.disabled_days {
font-style: italic;
color: silver;
cursor: auto;
}

in calendar_eu.js add (in function f_tcalUpdate):
(after var d_selected)
var d_older_than_disabled = this.a_cfg.older_than_disabled ? this.f_parseDate(this.a_cfg.older_than_disabled) : '';

(after // selected clause)
// disabled days
if (d_older_than_disabled.valueOf()!='' && d_current.valueOf() < d_older_than_disabled.valueOf()) {
a_class[a_class.length] = 'disabled_days';
s_html += '<td ' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
} else {
s_html += '<td onclick="A_TCALS['' + this.s_id + ''].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'
}

remove: (because it is included in previous bit)
s_html += '<td onclick="A_TCALS['' + this.s_id + ''].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/