diff --git a/src/Calendar/index.ts b/src/Calendar/index.ts index 1acb001..cbfd84e 100644 --- a/src/Calendar/index.ts +++ b/src/Calendar/index.ts @@ -1,5 +1,4 @@ import { GroupTypes } from "../types"; -import Config from "../Config/Config"; import Events from "../Events/"; import { DayGrouping, WeekGrouping, MonthGrouping } from "../EventGrouping"; import { @@ -10,19 +9,17 @@ import { export default class Calendar { private readonly jsonContent: object; - public config: Config; + public groupType: GroupTypes; public events: Events; constructor(json) { this.jsonContent = json; - this.config = new Config({ - groupType: json["group"] ? json["group"].charAt(0) : GroupTypes.Day, - }); + this.groupType = json["group"] ? json["group"].charAt(0) : GroupTypes.Day; this.events = new Events(json["events"]); } render(): HTMLDivElement { - switch (this.config.groupType) { + switch (this.groupType) { case GroupTypes.Day: return new DayRenderer( new DayGrouping(this.events.sortedEvents) diff --git a/src/Config/Config.ts b/src/Config/Config.ts deleted file mode 100644 index b5be1bc..0000000 --- a/src/Config/Config.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { GroupTypes } from "../types"; - -export default class Config { - groupType: GroupTypes; - - constructor({ groupType }) { - this.groupType = groupType.toUpperCase(); - } -}