<% // First day of week if( !this.day ) this.day = new Date(); var cal_d = this.day; cal_d = cal_d.addDays( 1 - (cal_d.getDay() == 0 ? 7 : cal_d.getDay()) ); var cal_today = new Date(); // Today if( !this.week ) this.week = 0; if( !this.firstday ) this.firstday = cal_d; if( !this.hourslist ) this.hourslist = []; if( !this.datalist ) this.datalist = []; this.buildquickdatalist(); %>
<% cal_d = cal_d.addDays(-10 * 7); %> <% for(var cal_windex = -10; cal_windex < 52; cal_windex++) { console.log("Week " + cal_windex, cal_d); var cal_month = ("0" + (cal_d.getMonth() + 1)).slice(-2); %>
<% } %>
<%= this.day.formatFullLatin() %>
<% if( this.hourslist ) { // For each hour var cal_d = this.day.addDays( 1 - (this.day.getDay() == 0 ? 7 : this.day.getDay()) ); for(var cal_ii = 0; cal_ii < this.hourslist.length; cal_ii++) { var thour = trim(fbobjectdata(this.hourslist[cal_ii])); %>
<%= thour %>
<% // For each week day for( var cal_iday = 0; cal_iday < 7; cal_iday++ ) { var tindex = this.quickdatalist.indexOf(cal_d.addDays(cal_iday).formatSql() + ' ' + thour); var toccupied = tindex >= 0; var teventtext = tindex >= 0 ? this.quickdatalistdisplay[tindex] : 'DISPONIBLE'; if( this.enablefrom && this.enablefrom != '' ) { if( cal_d.addDays(cal_iday).formatSql() < parseDate(this.enablefrom).formatSql() ) { toccupied = true; teventtext = 'NO DISPONIBLE'; } } if( this.enableto && this.enableto != '' ) { if( cal_d.addDays(cal_iday).formatSql() > parseDate(this.enableto).formatSql() ) { toccupied = true; teventtext = 'NO DISPONIBLE'; } } if( tindex > 0 ) { console.log("[hourrender] day ", cal_d.addDays(cal_iday).formatSql()); console.log("[hourrender] qdl " , this.quickdatalist[tindex]); } %>
<%= teventtext %>
<% } %>
<% } } %>
<% if( !$.isFunction(this.onclick) ) { %><% } %>