cloud-atlas-ai / obsidian-ics

Generate Daily Planner from ical feeds
MIT License
142 stars 27 forks source link

Issue processing Google calendar feed: No toISOString function #124

Closed Intellek-help closed 7 months ago

Intellek-help commented 7 months ago

As of latest update to ICS plugin ( 5th April 2024 ) I am getting an error processing my Google Calander feed. I have tried removing it and reading but still get the error shown below:

plugin:ics:27 Error processing calendar Google: Error: No toISOString function in curr.start

Some more info after removing and manually installing v 1.6.6.1:

plugin:ics:6 Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info. Arguments: [0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 00:20240406T100000, _f: undefined, _strict: undefined, _locale: [object Object] Error at Function.eval [as createFromInputFallback] (plugin:ics:9:3) at ec (plugin:ics:9:24533) at ic (plugin:ics:9:28300) at OO (plugin:ics:9:28167) at rc (plugin:ics:9:27886) at oO (plugin:ics:9:28660) at y0 (plugin:ics:9:28694) at p (plugin:ics:6:850) at Object.END (plugin:ics:21:5506) at Object.handleObject (plugin:ics:21:6887)

muness commented 7 months ago

Hi @Intellek-help :

I haven't been able to reproduce this. Any idea of what event might be related? I suspect it's a timezone string in one of your events.

Intellek-help commented 7 months ago

@muness Thanks, that does seem likely although I'm not sure if it was a specific event as it happened over multiple days, I have set up Obsidian to open my daily note and pull down events for that day using the code below in my daily note template, the error happened on multiple days before I raised the issue as I had thought it could be event specific but got the same error each day for my Google calendar but not Office 365 calendar which might suggest something related to the calendar.

<%* var events = await app.plugins.getPlugin('ics').getEvents(moment(tp.file.title,'YYYY-MM-DD')); events.sort((a,b) => a.utime - b.utime).forEach((e) => { tR+=- [ ] ${e.time} ${e.summary} ${e.location? e.location : ''}\n }) %>

As you are not able to replicate and it doesn't appear anyone else is having the issue I think it's fair to say it's my problem not yours. I'll keep digging as and when I have time and if I find anything usable I will report back to you. In the mean time I'm going to close the issue.

I appreciate all the work you have put into this plugin. Thank you.