1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-20 04:06:34 +01:00
openstamanager/modules/statistiche/js/manager.js
2020-02-14 17:02:16 +01:00

39 lines
747 B
JavaScript
Executable File

class Manager {
constructor(info) {
this.info = info;
this.calendars = {};
}
remove(name) {
if (Object.keys(this.calendars).length > 1) {
this.calendars[name].remove();
delete this.calendars[name];
return true;
}
return false;
}
add(id, name) {
var calendar = new Calendar(this.info, id);
this.calendars[name] = calendar;
return calendar;
}
init(name) {
var calendar = this.calendars[name];
var start = this.info.start_date;
var end = this.info.end_date;
calendar.update(start, end);
}
update(name, start, end){
this.calendars[name].update(start, end);
}
}