1

This is my JS function:

async function get_days(){
    **b = await eel.get_events('ofek')();**
    alert(b);
    startPoint = new Date(year, month - 1, 1).getDay(); // 0=Sunday
    numberOfDaysInMonth = new Date(year, month, 0).getDate(); // setting the number of days in the current month
    numberOfDaysInPrevMonth = new Date(year, month - 1, 0).getDate(); // setting the number of days in the prev month
    content = "";
    for (j = 1; j <= startPoint; j++) {
        content += "<li class='prev_next'>" + (numberOfDaysInPrevMonth - startPoint + j) + "</li>";

    }
    // TODO
    for (i = 1; i <= numberOfDaysInMonth; i++){
        if (i == currentDate.getDate() && month == currentDate.getMonth() + 1 && year == currentDate.getFullYear()){
            content += "<li onclick='return open_create_event_screen();' class='active'>" + i + "</li>";
        }
        else if (i > currentDate.getDate() && month < currentDate.getMonth() + 1 && year == currentDate.getFullYear()) { // TODO
            content += "<li onclick='return open_create_event_screen();'>" + i + "</li>";
        }
        else { // if the date has already passed - no ability to create event
            content += "<li>" + i + "</li>";
        }
    }

    numberOfDaysNextMonth = 7 - (new Date(year, month, 0).getDay() + 1);
    for (n = 1; n <= numberOfDaysNextMonth; n++) {
        content += "<li class='prev_next'>" + n + "</li>";
    }

    daysDiv.innerHTML = content;
    document.getElementById("current_month").innerHTML = monthNames[month - 1];
    document.getElementById("current_year").innerHTML = year;

}

This is my python code where I call to the function get_events (using eel):

@eel.expose
def get_events(username):
    print("get_events")
    name_of_events = client.get_events(username)
    print(name_of_events)
    return name_of_events

The problem is in the bolded line. The ERROR is: 'Uncaught (in promise) ReferenceError: eel is not defined'. Does someone know why it thinks eel is not definded?

ofek tal
  • 21
  • 3

0 Answers0