From 7a49157fefc5fc5bb994d2946039d9398a4287b2 Mon Sep 17 00:00:00 2001 From: Franco Speziali Date: Wed, 16 Mar 2022 08:35:17 +0100 Subject: [PATCH] Added Calendar class --- src/Calendar/index.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/Calendar/index.ts diff --git a/src/Calendar/index.ts b/src/Calendar/index.ts new file mode 100644 index 0000000..6d4d882 --- /dev/null +++ b/src/Calendar/index.ts @@ -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 + ); + } +}