I parse then on the unix format so i have then in the same format as the template (a UNIXdate for the start and end of each month, and there is a (undescore) GET with the current UNIX timestamp
$.ajax({
type: "GET",
url: modules/demo.php?ini='+ini+ '&fim='+fim;,
timeout: 3000,
contentType: "application/json; charset=utf-8",
cache: false,
error: function() {
$("#eventos_mensais").html("O servidor não conseguiu processar o pedido");
},
success: function(retorno) {
var dados = JSON.parse(retorno);
if(testa_empty(dados)){
//$("#eventos_mensais").hide();
$("#eventos_mensais ul").empty();
var li = '<li>Sem Eventos Mensais</li>';
$('#eventos_mensais ul').append(li);
}
else{
$("#eventos_mensais").show();
$("#eventos_mensais ul").empty();
$.each(dados,function(i, d){
var li = '<li><i class="lista_icon fa fa-'+d.sec_icon+'"></i><a href="javascript:void(0)" data-event-id="'+d.id+'"><span class="lista_evento_mensal">' +d.title+'</span></a></li>';
$('#eventos_mensais ul').append(li);
});
}
}
});
}
The code above just returns the events in a unerdored list with the data-event-id needed for the modal.
I've researched that i need to modify the calendar code removing the this.context on line 1077
$('a[data-event-id]', this.context).on('click', function(event) { REMOVE THIS CONTEXT
so i can use the event outside the calendar (I guess this could be a option, like Click Events: Global or Calendar).
I made a function that uses the GET values sent to the templates or using the position atribute of the calendar.
calendar.options.position.start calendar.options.position.end
I parse then on the unix format so i have then in the same format as the template (a UNIXdate for the start and end of each month, and there is a (undescore) GET with the current UNIX timestamp
The code above just returns the events in a unerdored list with the data-event-id needed for the modal.
I've researched that i need to modify the calendar code removing the this.context on line 1077 $('a[data-event-id]', this.context).on('click', function(event) { REMOVE THIS CONTEXT so i can use the event outside the calendar (I guess this could be a option, like Click Events: Global or Calendar).
But it only activates on simple photo1 photo2