obsidian-ics: recurrent events now break plugin completely. What has changed?
For the last five days, the plugin has been horrible broken: it finds huge numbers of recurrent events from past years ands spews them into my daily note, complaining about “Invalid date” — this with a template that was working perfectly well before Christmas.
Using this template fragment (adjusted to fit the way I name my diaries):
<%*
var events = await app.plugins.getPlugin('ics').getEvents(moment(tp.file.title,'DD MMMM YYYY - dddd'));
if (events.length) {
tR+= `>[!Danger]- Today's Schedule\n`
events.sort((a,b) => a.utime - b.utime).forEach((e) => {
const calendar = e.icsName.replace(" ","-");
const callUrl = e.callUrl? ` [${e.callType}](${e.callUrl})` : '';
const location = e.location? ` 📍 *(${e.location})*` : '';
tR+=`- [ ] ${e.time}-${e.endTime} **${e.summary}**${location}${callUrl} #${calendar}\n`
if (e.description) {
const inlineDescription = e.description.replace(/(?:\r\n|\r|\n)/g," ").replace(/\s{2,}/g," ");
tR+=` - ${inlineDescription}\n`
}
})
}
%>
I get hundreds of lines complaining of “Invalid date” in recurring events that have long since passed, and don’t in any case affect today:
like this:
# testing ICS
- [ ] Invalid date-Invalid date **Mary Heley** 📍 *(XXXXXX)* #seatrout
{Repeat 17 times}
- [ ] Invalid date-Invalid date **Renew prescription** #seatrout
- [ ] {repeat 164 times}
- [ ] Invalid date-Invalid date **RMC editorial meeting** 📍 *(zoom see below)* #seatrout
{ repeat 12 times}
... and so on, some of these errors going back *20 years*
I have tried this with a conventionally named date template too: it is clearly something in the handling of recurrent events in the plugin.
About this issue
- Original URL
- State: closed
- Created 6 months ago
- Comments: 27 (16 by maintainers)
Everything still works, and I am still grateful 😃 But in the night I thought of a reason that you might not have been able to reproduce this bug: all of the problems I can remember were expired sequences of recurring events. Recurring events which are still recurring today didn’t, so far as I can remember, trigger the bug. But eg “Ann the cleaner” (from my example upthread) no longer comes to clean, so all her end dates showed up as invalid. I think that’s it, anyway.
Happy to help test this But when I look at these complications and dependencies I am so glad I am not a developer.