Closed shernandezp closed 1 year ago
Your HTML looks a little off. HEAD tags are not supposed to be in the body.
I've just written this for you to get something working:
<!DOCTYPE html>
<html>
<head>
<title>Calendar.js</title>
<link rel="stylesheet" href="../../dist/calendar.js.css" />
<script src="../../dist/calendar.js"></script>
</head>
<body>
<div id="calendar"></div>
</body>
<script>
var calendarInstance = new calendarJs( "calendar", {
exportEventsEnabled: true,
} );
document.title += " v" + calendarInstance.getVersion();
var event = {
from: new Date(),
to: new Date(),
title: "New Event",
description: "A description of the new event"
};
calendarInstance.addEvent( event );
</script>
</html>
Let me know how you get on. As of now, this is something I cannot recreate.
Describe the bug The calendarJs object cannot be instantiated. I downloaded the latest version and created a simple html in a local folder adding only the reference of calendar.js and I got the error "Uncaught TypeError: Cannot read properties of undefined (reading 'addEvent')" when trying to add a new Event to the calendar.
To Reproduce Steps to reproduce the behavior:
` <!DOCTYPE html>
`
Expected behavior calendarInstance not to be undefined and be able to add a new event.
Screenshots
Desktop (please complete the following information):
Additional context Add any other context about the problem here.