Callbacks not firing

Create issue
Issue #24 resolved
Former user created an issue

I'm having an issue with callbacks not working, and I can't for the life of me figure out why.

I'm using the code along with wordpress events manager as follows :

        events: {
            <?php if (class_exists('EM_Events')) {
                echo EM_Events::output(array(
                    'format'=>'"#_{Y-m-d}": {
                        "number": "1",
                        "url": "#_EVENTURL",
                        "dayEvents": [
                              "name": "#_EVENTNAME",
                              "starttime": "#_24HSTARTTIME",
                              "endtime": "#_24HENDTIME"
                    },') );  
            } ?>    
        onActiveDayClick: function(events) {
            alert('Active click');
        onDayClick: function(events) {
            alert('Day click');

The EM_Events::output call is working fine and successfully populating the calendar with the events, but the callbacks aren't having any effect. None-active days do nothing (no errors reported in the console), and active days the URL takes hold and the new page loads.

Please advise, especially if I'm doing something stupid.



Comments (5)

  1. Georgi Georgiev

    I am having a similar problem with active events: none of the active events are working:

    function init_Calendar() {
        var now = moment()
        var calendar = $('#calendar');
        var settings = new Object();
        var month = now.month() + 1;
        month = addLeadingZero(month);
        settings.time = now.year() + '-' + month;
        settings.onMonthChange = loadEventsForMonth;  //works
        settings.onInit = loadEventsForMonth; //works
        settings.onDayClick = onDay; //works
        settings.onActiveDayClick = function(events){ //does not work fires onDayClick only...
  2. Georgi Georgiev

    Well this is strange. I do not know why it is not working for me. I am using exactly the code I posted above and I do not see nothing wrong with it. Its is also not much different from yours. I soled it by checking if the day has active class in the onDayClick event.

  3. Log in to comment