urishiraval / obsidian-apple-reminders-plugin

A plugin to attempt to bring Apple Reminders into Obsidian.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

{Bug report} Plugin displays 'invalid date' with all fetched tasks that have a date assigned to them

Placeholder-spec opened this issue · comments

I'm on the new Mac OS 13. The plugin can no longer adequately fetch dates from apple reminders. It displays tasks per list, but gives 'invalid date' under each task, making filtering based on dates impossible.

There is no daily note being used. So the 'caveat' is not applicable in this case.

commented

I have the same issue. I thought it could be due to the fact I use format DD-MM-YYYY on reminders. IDK if it is related. If it is, having an option to set date format would fix this

I believe this is due to the due date field calling APPLE_DATE_FORMAT, which is hard-coded and breaks for regions that don't use dddd, DD MMMM formatting (such as the United States or Canada).

You can work around that by setting your system preferences in OSX to use a region with a supported datetime format (like the UK or South Africa) for now. However, anything with a non-2022 date will break... presumably this is a due to a different bug, though I have yet to figure out what's causing it.

You can work around that by setting your system preferences in OSX to use a region with a supported datetime format (like the UK or South Africa) for now. However, anything with a non-2022 date will break... presumably this is a due to a different bug, though I have yet to figure out what's causing it.

Hi folks ! Same issue here with non 2022 dates.
It's not a big deal as we are in 2022 but it could be problematic in a few days.

As previous commenters pointed out, issue is with date format. So I manually modified the plugin
var APPLE_DATE_FORMAT = "dddd, MMMM DD, YYYY at H:mm:ss";

@emiraga - curious how you implemented the fix. I tried applying that variable to the main.js file and am still getting "Invalid Date" for reminders

From issue #2 I tried the test Apple Script:

tell list 'list_name' in application "Reminders"
   set buffer to ((current date) - minutes * 5)
   return properties of reminders whose completion date comes after buffer or completed is false	
end tell

Output:

{{remind me date:date "Friday, May 13, 2022 at 12:00:00 AM", flagged:false, modification date:date "Saturday, July 16, 2022 at 12:00:00 PM", completion date:missing value, creation date:date "Friday, May 13, 2022 at 8:18:00 AM", completed:false, allday due date:date "Friday, May 13, 2022 at 12:00:00 AM", priority:0, container:list id "74A85AB6-0051-EE3F-4F11-88792824EC86" of application "Reminders", body:missing value, id:"x-apple-reminder://9B129D18-D5D5-5003-BA7E-5D0F1C206CC4", due date:date "Friday, May 13, 2022 at 12:00:00 AM", name:"Check Routing - Blackhole"}, {flagged:false, modification date:date "Wednesday, May 18, 2022 at 3:55:00 PM", id:"x-apple-reminder://F94D4D90-E0ED-59A5-8912-C24F0FB46BA8", due date:missing value, creation date:date "Wednesday, May 18, 2022 at 3:55:00 PM", priority:0, name:"https://aws.amazon.com/blogs/security/build-a-strong-identity-foundation-that-uses-your-existing-on-premises-active-directory/", container:list id "74A85AB6-0051-EE3F-4F11-88792824EC86" of application "Reminders", allday due date:missing value, body:missing value, remind me date:missing value, completed:false, completion date:missing value}}