I'm using fullcalendar Sean Kenny's fork to add a resource view.
the problem is some events are just displayed under the month view, not in week or resource view.
allDay is set to false for all events
$(document).ready(function() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,resourceDay'
},
monthNames: ["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" ],
monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun','Jul','Ago','Sep','Oct','Nov','Dic'],
dayNames: [ 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
dayNamesShort: ['Dom','Lun','Mar','Mie','Jue','Vie','Sab'],
buttonText: {
today: 'hoy',
month: 'mes',
week: 'semana',
day: 'dia'
},
allDaySlot : false,
slotDuration: '00:15:00',
axisFormat: 'HH:mm',
firstDay : 1,
minTime: '09:00:00',
maxTime: '20:00:00',
defaultView: 'resourceDay',
allDayDefault: false,
editable: true,
droppable: true,
disableResizing: false,
resources: [{
'id': '1',
'name': 'Sara'
}, {
'id': '2',
'name': 'Angela'
}],
selectable: true,
selectHelper: true,
events: '\load_events.php',
select: function(start, end, ev) {
console.log(ev.resources);
var horaIni = moment(start).format("YYYY-MM-DD HH:mm:ss");
var horaFin = moment(end).format("YYYY-MM-DD HH:mm:ss");
if(isHoraMaxOver(end)){
alert(mensajeHoraMax);
}else if(isEventOverlapped(ev,horaIni,horaFin)){
alert(mensajeOverlap);
}else if(isDomingo(horaIni)){
alert("Los Domingos descansamos. Lo siento");
}else{
createEvent(horaIni,horaFin,ev);
}
},
eventClick: function(calEvent, jsEvent, view){
if(isAdmin()){
modifyEvent(calEvent);
}
},
eventDrop: function (event, delta, revertFunc) {
var start = moment(event.start).format("YYYY-MM-DD HH:mm:ss");
var end = moment(event.end).format("YYYY-MM-DD HH:mm:ss");
if(isHoraMaxOver(end)){
alert(mensajeHoraMax);
}else if(isEventOverlapped(event,start,end)){
alert(mensajeOverlap);
}else if(isDomingo(start)){
alert("Los Domingos descansamos. Lo siento");
}else{
$.ajax({
url: 'update_event.php',
data: 'fechaIni='+ start +'&fechaFin='+ end +'&id='+ event.id +'&profesional='+ event.resources,
type: "POST"
});
}
$('#calendar').fullCalendar('refresh');
location.reload(true);
},
loading: function(bool){
if(!bool){
diableforInvitados();
updateResources();
}
},
eventRender: function(event, element) {
element.find('.fc-event-title').append("<br/>" + event.description);
},
eventResize: function(event, delta, revertFunc) {
var start = moment(event.start).format("YYYY-MM-DD HH:mm:ss");
var end = moment(event.end).format("YYYY-MM-DD HH:mm:ss");
if(isHoraMaxOver(end)){
alert(mensajeHoraMax);
}else if(isEventOverlapped(event,start,end)){
alert(mensajeOverlap);
}else{
$.ajax({
url: 'update_event.php',
data: 'fechaIni='+ start +'&fechaFin='+ end +'&id='+ event.id,
type: "POST"
});
}
$('#calendar').fullCalendar('refresh');
location.reload(true);
}
});
$("#calendar").fullCalendar('rerenderEvents');
});
Here is an example of a JSON feed for an event
Object {id: "63", title: "mariana _", start: FCMoment, end: FCMoment, description: "manicura express esmalte normal 12mins 30.00 € <br/>"…}_allDay: false_end: FCMoment_d: Tue Nov 11 2014 21:12:00 GMT-0500 (Eastern Standard Time)_f: "YYYY-MM-DDTHH:mm:ssZ"_i: "2014-11-12T02:12:00-0500"_isAMomentObject: true_isUTC: true_locale: f_offset: 300_pf: Object_tzm: 300__proto__: f_id: "63"_start: FCMoment_d: Tue Nov 11 2014 21:00:00 GMT-0500 (Eastern Standard Time)_f: "YYYY-MM-DDTHH:mm:ssZ"_i: "2014-11-12T02:00:00-0500"_isAMomentObject: true_isUTC: true_locale: f_offset: 300_pf: Object_tzm: 300__proto__: fallDay: falseclassName: Array[0]color: "#00FF1E"description: "manicura express esmalte normal 12mins 30.00 € <br/>"end: FCMomentid: "63"resources: "1"source: Objectstart: FCMomenttitle: "mariana _"__proto__: Object
Here is the link for the current web page: Web page