96 lines
2.0 KiB
JavaScript
96 lines
2.0 KiB
JavaScript
/**
|
|
* get the data from schedule
|
|
*/
|
|
var Schedule = class {
|
|
|
|
/**
|
|
* the schedule xml object parsed as jQuery object
|
|
*/
|
|
schedule = false;
|
|
|
|
/**
|
|
* Array of talks
|
|
*
|
|
* [{
|
|
* id: 2132,
|
|
* title: "foobar"
|
|
* date:2018-09-22T10:30:00+02:00
|
|
* }]
|
|
*/
|
|
talks = [];
|
|
|
|
|
|
query = {
|
|
time : { 'from' : new Date, 'to' : new Date }
|
|
}
|
|
|
|
|
|
/**
|
|
*
|
|
*/
|
|
talkPrototype = {
|
|
'date' : '1970-01-01T00:00:00+02:00',
|
|
'start' : '1970-01-01T00:00:00+02:00',
|
|
'duration' : '00:15',
|
|
'room' : 'Großer Saal',
|
|
'slug' : 'DS2018-9336-eroffnung',
|
|
'url' : '/2018/fahrplan/events/9336.html',
|
|
'title' : 'Eröffnung',
|
|
'subtitle' : 'Datenspuren 2018',
|
|
'track' : '',
|
|
'type' : '',
|
|
'language' : 'de',
|
|
'abstract' : 'Eröffnung der Datenspuren 2018',
|
|
'description' : 'Opening Datenspuren 2018',
|
|
'logo' : false,
|
|
'persons' : { 'id' : '7339', 'name' : 'Nerd Norbert' }
|
|
}
|
|
|
|
/**
|
|
* class constructor
|
|
*/
|
|
constructor(scheduleXml){
|
|
this.schedule = scheduleXml;
|
|
this.talks = this.getTalks();
|
|
}
|
|
|
|
/**
|
|
* @return String the schedule title
|
|
*/
|
|
getScheduleTitle(){
|
|
return this.schedule.find("title")[0]
|
|
}
|
|
|
|
/**
|
|
* return array of all talks
|
|
*/
|
|
getTalks(){
|
|
this.schedule.find('event');
|
|
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* get next talks by time and room
|
|
*
|
|
* @param {Timestamp} minimum time to start
|
|
* @param {*} room
|
|
*/
|
|
getTalk(time, room){
|
|
|
|
return talk;
|
|
}
|
|
|
|
/**
|
|
* get the next talks, based on time
|
|
* @param {Date} time
|
|
*/
|
|
getNextTalks(time){
|
|
let startTime = new Date(Date.now())
|
|
|
|
this.query.time.from = time.toISOString();
|
|
console.log(this.query);
|
|
}
|
|
|
|
}
|