@sdetweil said in MMM-CalendarEXT2 - Calendar Read Failing When Time Value Is Missing from ics file:
and will have to fix it yourself
I know, that’s what I’m asking for help with here. :)
I don’t understand in the code where the call to the ics file occurs. If I can find it and just append 0’s where no time exists, I believe that will solve it.
I found this in CALEXT2_Event.js. Any idea if this is where the call is made?
const now = moment().locale(locale);
if (this.useEventTimeRelative) {
let status = "current";
if (this.mEnd.isBefore(now)) status = "passed";
if (this.mStart.isAfter(now)) status = "future";
const timeDom = document.createElement("div");
timeDom.classList.add("relative");
timeDom.classList.add(status);
timeDom.innerHTML = this.relativeFormat[status]
.replace("%ENDFROMNOW%", this.mEnd.fromNow())
.replace("%STARTFROMNOW%", this.mStart.fromNow())
.replace("%DURATION%", dur.humanize());
if (typeof this.dateFormat === "string") {
timeDom.innerHTML
.replace("%STARTDATE%", this.mStart.format(this.dateFormat))
.replace("%ENDDATE%", this.mEnd.format(this.dateFormat));
}
time.appendChild(timeDom);
} else {
let sd;
let ed;
let st;
let et;
let sdt;
let edt = null;
if (typeof this.dateFormat === "object") {
sd = this.mStart.calendar(null, this.dateFormat);
ed = this.mEnd.calendar(null, this.dateFormat);
} else {
sd = this.mStart.format(this.dateFormat);
ed = this.mEnd.format(this.dateFormat);
}
if (typeof this.timeFormat === "object") {
st = this.mStart.calendar(null, this.timeFormat);
et = this.mEnd.calendar(null, this.timeFormat);
} else {
st = this.mStart.format(this.timeFormat);
et = this.mEnd.format(this.timeFormat);
}
if (typeof this.dateTimeFormat === "object") {
sdt = this.mStart.calendar(null, this.dateTimeFormat);
edt = this.mEnd.calendar(null, this.dateTimeFormat);
} else {
sdt = this.mStart.format(this.dateTimeFormat);
edt = this.mEnd.format(this.dateTimeFormat);
}
time.appendChild(makeEventTime(sd, "startDate start date"));
time.appendChild(makeEventTime(st, "startTime start time"));
time.appendChild(makeEventTime(sdt, "startDateTime start dateTime"));
time.appendChild(makeEventTime(ed, "endDate end date"));
time.appendChild(makeEventTime(et, "endTime end time"));
time.appendChild(makeEventTime(edt, "endDateTime end dateTime"));
}
return time;