createListElement(events, date, availableEvents){
        let listItem = document.createElement("LI");
        
        for(let i = 0; i < events.length; i++){
            const timeslot = events[i].startTime + ' - ' + events[i].endTime;
            listItem.id = this.id + "-list-item-" + i;
    
            let division = document.createElement("DIV");
            
            let checkbox = document.createElement('INPUT');
            checkbox.setAttribute('type', 'checkbox');
            this.setTimeslotListener(checkbox, date, timeslot);

            let span = document.createElement("SPAN");
            span.id = this.id + "-list-item-" + i + "-time";
            span.class = this.id + " time";
            span.appendChild(document.createTextNode(events[i].startTime + ' - ' + events[i].endTime));

            division.appendChild(span);
    
            let paragraph = document.createElement("P");
            paragraph.id = this.id + "-list-item-" + i + "-text";
            paragraph.appendChild(document.createTextNode(events[i].text));
            
            if(availableEvents) paragraph.appendChild(checkbox);

            listItem.appendChild(division);
            listItem.appendChild(paragraph);
        }
        
        return listItem

    }
//TODO: Research the possibility to make the elment a bit less complex.
Research the possibility to make the elment a bit less complex.
Research the possibility to make the elment a bit less complex .
createListElement(events, date, availableEvents){
        let listItem = document.createElement("LI");
        for(let i = 0; i < events.length; i++){
            const timeslot = events[i].startTime + ' - ' + events[i].endTime;
            listItem.id = this.id + "-list-item-" + i;
            let division = document.createElement("DIV");
            let checkbox = document.createElement('INPUT');
            checkbox.setAttribute('type', 'checkbox');
            this.setTimeslotListener(checkbox, date, timeslot);
            let span = document.createElement("SPAN");
            span.id = this.id + "-list-item-" + i + "-time";
            span.class = this.id + " time";
            span.appendChild(document.createTextNode(events[i].startTime + ' - ' + events[i].endTime));
            division.appendChild(span);
            let paragraph = document.createElement("P");
            paragraph.id = this.id + "-list-item-" + i + "-text";
            paragraph.appendChild(document.createTextNode(events[i].text));
            if(availableEvents) paragraph.appendChild(checkbox);
            listItem.appendChild(division);
            listItem.appendChild(paragraph);
        }
        return listItem
    }
createListElement ( events , date , availableEvents ) { let listItem = document . createElement ( "LI" ) ; for ( let i = 0 ; i < events . length ; i ++ ) { const timeslot = events [ i ] . startTime + ' - ' + events [ i ] . endTime ; listItem . id = this . id + "-list-item-" + i ; let division = document . createElement ( "DIV" ) ; let checkbox = document . createElement ( 'INPUT' ) ; checkbox . setAttribute ( 'type' , 'checkbox' ) ; this . setTimeslotListener ( checkbox , date , timeslot ) ; let span = document . createElement ( "SPAN" ) ; span . id = this . id + "-list-item-" + i + "-time" ; span . class = this . id + " time" ; span . appendChild ( document . createTextNode ( events [ i ] . startTime + ' - ' + events [ i ] . endTime ) ) ; division . appendChild ( span ) ; let paragraph = document . createElement ( "P" ) ; paragraph . id = this . id + "-list-item-" + i + "-text" ; paragraph . appendChild ( document . createTextNode ( events [ i ] . text ) ) ; if ( availableEvents ) paragraph . appendChild ( checkbox ) ; listItem . appendChild ( division ) ; listItem . appendChild ( paragraph ) ; } return listItem }
TODO: Research the possibility to make the elment a bit less complex.
TODO : Research the possibility to make the elment a bit less complex .