Added Calendar class

This commit is contained in:
Franco Speziali 2022-03-16 08:35:17 +01:00
parent 32db96c9ad
commit 7a49157fef

22
src/Calendar/index.ts Normal file
View File

@ -0,0 +1,22 @@
import Config from "../Config/Config";
import Events from "../Events/";
import EventGrouping from "../EventGrouping";
export default class Calendar {
private readonly jsonContent: object;
public config: Config;
public events: Events;
public eventGrouping: EventGrouping;
constructor(json) {
this.jsonContent = json;
this.config = new Config({
scale: json["scale"].charAt(0),
});
this.events = new Events(json["events"]);
this.eventGrouping = new EventGrouping(
this.events.sortedEvents,
this.config.scale
);
}
}