My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 74 attachment: custom color for day with events and without events.js (3.7 KB)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
$('#calendar').fullCalendar({
viewDisplay: function(view){
dateArr = [];
var today = $('#calendar').fullCalendar('getDate');
var viewData = $('#calendar').fullCalendar('getView');
cMonth = today.getMonth();
cYear = today.getFullYear();
$('td .fc-state-default').css('background','#FFFFFF');
$('.fc-day-number').each(function(){

lDay = parseInt($(this).text());
//check if it is another month date
if($(this).parents('td').hasClass('fc-other-month'))
{
lYear = parseInt(cYear);
//if it is belong to the previous month
if(lDay>15)
{
lMonth = parseInt(cMonth) - 1;
lDate = new Date(lYear,lMonth,lDay);
dateArr.push(lDate);
}
else //belong to the next month
{
lMonth = parseInt(cMonth) + 1;
lDate = new Date(lYear,lMonth,lDay);
dateArr.push(lDate);
}
}
else
{
lMonth = parseInt(cMonth);
lDate = new Date(lYear,lMonth,lDay);
dateArr.push(lDate);
}

});
},
lazyFetching: true,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
loading: function(bool) {
if (bool) $('#boxLoading').show();
else $('#boxLoading').hide();
},
eventRender: function(event,element){
//rendering q-TIP
qtipContent = '<div><span class="qtipImage">';
if(event.picture.length > 0 )
{qtipContent = qtipContent + '<img src="<?php echo $this->imageUrl('upload/event/thumbnails/'); ?>'+event.picture+'" /></span>';}
else
{qtipContent = qtipContent + '<img src="<?php echo $this->imageUrl('default.jpg'); ?>" /></span>';}
qtipContent = qtipContent + '<span class="qtipDesc">'+event.description+'</span><span class="qtipMore">click events to read more</span></div>';
element.qtip({
content: qtipContent,
style: {
border: {
width: 3,
radius: 8,
color: '#A2D959'
},
width: 500
},
position: {
corner: {
target: 'center',
tooltip: 'bottomLeft'
}
}
});
//rendering color
//foreach event check each day on the calendar
for(var i in dateArr)
{
if((dateArr[i].getTime() >= event.start.getTime())&&(dateArr[i].getTime() <= event.end.getTime()))
{
console.log(dateArr[i].getDate()+'-'+dateArr[i].getMonth());
$('td .fc-day'+i).css('background','#000000');
}
}

},
editable: false,
events: "<?php echo $this->baseUrl('event/eventlist');?>"
});
Powered by Google Project Hosting