source: trunk/calendar/js/dhtmlx/sources/ext/ext_new_month.js @ 4705

Revision 4705, 2.1 KB checked in by roberto.santosjunior, 13 years ago (diff)

Ticket #1950 - Destacar feriados no módulo calendario (dia, semana, mes) r4550

Line 
1scheduler._reset_month_scale=function(b,dd,sd){
2        var ed=scheduler.date.add(dd,1,"month");
3
4        //trim time part for comparation reasons
5        var cd=new Date();
6        this.date.date_part(cd);
7        this.date.date_part(sd);
8
9        var rows=Math.ceil((ed.valueOf()-sd.valueOf())/(60*60*24*1000*7));
10        var tdcss=[];
11        var height=(Math.floor(b.clientHeight/rows)-22);
12
13        this._colsS.height=height+22;
14        var h = this._colsS.heights = [];
15        for (var i=0; i<=7; i++)
16                tdcss[i]=" style='height:"+height+"px; width:"+((this._cols[i]||0)-1)+"px;' "
17
18var cellheight = 0;
19        this._min_date=sd;
20        var html="<table cellpadding='0' cellspacing='0'>";
21        for (var i=0; i<rows; i++){
22                html+="<tr>";
23                        for (var j=0; j<7; j++){
24                                html+="<td";
25                                var cls = "";
26                                var clstitle = "";
27                                var aaaa = sd.getFullYear();
28                                var mm = sd.getMonth()+1;
29                                var dd = sd.getDate();
30                                aaaa = aaaa.toString();
31                                mm = mm.toString();
32                                dd = dd.toString();
33                                if(mm.length < 2) mm = '0' + mm;
34                                if(dd.length < 2) dd = '0' + dd;
35                                var aaaammdd = aaaa + mm + dd;
36                                if (holidayTab[aaaammdd])
37                                {
38                                        cls = 'dhx_holiday';
39                                        clstitle = holidayTab[aaaammdd];
40                                }
41
42                                if (sd<dd)
43                                        cls='dhx_before';
44                                else if (sd>=ed)
45                                        cls='dhx_after';
46                                else if (sd.valueOf()==cd.valueOf())
47                                        cls='dhx_now';
48
49                                if (sd.valueOf()==cd.valueOf() && holidayTab[aaaammdd])
50                                {
51                                        cls = 'dhx_now_holiday';
52                                        clstitle = holidayTab[aaaammdd];
53                                }
54
55
56                                html+=" class='"+cls+" "+this.templates.month_date_class(sd,cd)+"' ";
57                                html+="><div class='dhx_month_head' title='" + clstitle + "'>"+this.templates.month_day(sd)+"</div><div class='dhx_month_body' "+tdcss[j]+"></div></td>"
58                                sd=this.date.add(sd,1,"day");
59                        }
60                html+="</tr>";
61                h[i] = cellheight;
62                cellheight+=this._colsS.height;
63        }
64        html+="</table>";
65        this._max_date=sd;
66
67        b.innerHTML=html;
68        return sd;
69}
Note: See TracBrowser for help on using the repository browser.