0

I'm using a JavaScript library to display a calendar with events on my website.

The followings are the settings required:

    $('#evoCalendar').evoCalendar({
        todayHighlight: true,
        sidebarToggler: true,
        eventListToggler: true,
        canAddEvent: false,
        calendarEvents: calEvents,
        onSelectDate: function() {
            // console.log('onSelectDate!')
        },
        onAddEvent: function() {
            console.log('onAddEvent!')
        }
    });

calEvents is $.getJSON("JSON URL", function(json) {}); but events are not displayed, meanwhile, if I hard-code the JSON as value of calendarEvent, everything works as expected.

This is how my JSON looks like:

[
 {
   "name":"Leap day",
   "date":"February/29/2020",
   "type":"holiday",
   "everyYear":true
 }
]
gigapico00
  • 417
  • 1
  • 7
  • 24
  • 1
    [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) -> Add a [mcve] that shows the actual behavior. _"calEvents is `$.getJSON("JSON URL", function(json) {});`"_ - That might be the case, but right now it is just what you tell us. We don't know for sure. And because of the matter of AJAX it is important that we see where, when and how `calEvents` gets its value, because: [How to return the response from an asynchronous call](https://stackoverflow.com/questions/14220321) – Andreas Aug 26 '21 at 09:57
  • I thing you only need to return the result of your ajax request – diealtebremse Aug 26 '21 at 09:59

0 Answers0