Default to day grouping if no setting is provided
This commit is contained in:
parent
a1d1621a75
commit
df41f60101
@ -1,3 +1,4 @@
|
||||
import { GroupTypes } from "../types";
|
||||
import Config from "../Config/Config";
|
||||
import Events from "../Events/";
|
||||
import EventGrouping from "../EventGrouping";
|
||||
@ -11,7 +12,7 @@ export default class Calendar {
|
||||
constructor(json) {
|
||||
this.jsonContent = json;
|
||||
this.config = new Config({
|
||||
groupTypes: json["group"].charAt(0),
|
||||
groupTypes: json["group"] ? json["group"].charAt(0) : GroupTypes.Day,
|
||||
});
|
||||
this.events = new Events(json["events"]);
|
||||
this.eventGrouping = new EventGrouping(
|
||||
|
||||
@ -4,6 +4,6 @@ export default class Config {
|
||||
groupTypes: GroupTypes;
|
||||
|
||||
constructor({ groupTypes }) {
|
||||
this.groupTypes = groupTypes.toUpperCase() || GroupTypes.Week;
|
||||
this.groupTypes = groupTypes.toUpperCase();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user