mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 14:32:04 -04:00
[calendar] fix .ics
This commit is contained in:
parent
e8c375abf6
commit
077c16bffc
@ -78,6 +78,12 @@ module.exports.Event = class {
|
||||
|
||||
getDays(year) {
|
||||
year = parseInt(year);
|
||||
|
||||
if (this.daysMemoise === undefined) {
|
||||
// shouldn't happen, but somehow does, but only on prod?
|
||||
this.daysMemoise = {};
|
||||
}
|
||||
|
||||
if (this.daysMemoise[year] === undefined) {
|
||||
this.daysMemoise[year] = [...this.generator(iterateMonth(year, this.month))];
|
||||
}
|
||||
@ -111,6 +117,9 @@ module.exports.Event = class {
|
||||
|
||||
toIcs(year, translations, clearLinkedText, sequence = 1) {
|
||||
const days = this.getDays(year);
|
||||
if (!days.length) {
|
||||
return null;
|
||||
}
|
||||
const first = days[0];
|
||||
const last = days[days.length - 1].next();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user