$(document).ready(function()
{
  $(document).on("click", '.editar-evento', function()
  {
    var eventoid = $(this).data('eventoid');
    $.ajax({
      url: '/app/elements/functions/ajax.php',
      type: 'POST',
      data: {"ajax": "modal_evento_editar", "eventoid": eventoid},
      cache: false,
      success: function(response){
        $('#event-modal').html(response);
        $(".selectize").select2();
        $('.datetimepicker').datetimepicker({
    			format: 'YYYY-MM-DD',
    			icons: {
    				up: "fa fa-angle-up",
    				down: "fa fa-angle-down",
    				next: 'fa fa-angle-right',
    				previous: 'fa fa-angle-left',
    			}
    		});
        $('.datetimepicker3').datetimepicker({
    			format: 'HH:mm',
    			icons: {
    				up: "fa fa-angle-up",
    				down: "fa fa-angle-down",
    				next: 'fa fa-angle-right',
    				previous: 'fa fa-angle-left'
    			}
    		});
        //$('#event-modal').modal('show');
      }
    });
  });

  $(document).on("click", '.adicionar-evento-botao', function(e)
  {
    e.preventDefault();
    var form = $("#add_event").find("form");
    console.log(form);
    $('#add_event').modal('show');
    form[0].reset();
  });

});
