Radhika Radhika - 1 month ago 4
jQuery Question

delete one day total events usign onclick function in fullcalendar

var day='';

jQuery(document).ready(function(){
$(".fc-day-number").before("<img src="+base_url+"assets/images/del.jpg style='height:10px;width:10px' name='date' id='data-date' onClick=afunction();>");

});

function afunction()
{


$('.fc-day-number').click(function() {
// Get current day
day = parseInt($(this).html());
alert(day);
});



$('#event-modal').modal('hide');

var projects =<?php echo $schedule; ?>;
}


In this
onClick
function I cant get that day number.

Answer

I would suggest you not use to the classes to target the element.

You can directly use the fullCalendar events to get the entire date from it.

Here's the link.

$('#element').fullCalendar({
   dayClick: function(date, jsEvent, view) {
     alert(date.getDate());
   }
})
Comments