Normally this indicates a syntax error in JavaScript code, like this:
alert(1 1);
However, in this case it is probably a bad response from the server. DayPilot expects a JSON string which it is trying to parse. If there is a server-side error of a high level (such as a security mis-configuration) the AJAX call will receive an HTML page instead of JSON.
If you open the JavaScript console and track the network requests you will be able to see the HTML source of the response with more details about the actual error.
Look for a POST request to the original page URL.