I tried running through setting the due date to null and undefined like you did, and tried forcing a property deletion, but like your tests, none were successful.
I think (as in this really is a guess) the issue here is that you don’t actually want to change the value of the due date per se, but rather, you want to disable the options for specifying the due date. These show as checkboxes in a reminder, and it is modifying these checkboxes that I think is unavailable to the reminders scripting object in Drafts as it currently stands.
Based on that, I would see the only practical workaround to be, as previously suggested, to copy the properties of the existing reminder, delete it, and recreate it anew, but without the due date (/time) properties being set. I think when they are set, it might set these other properties that are not directly accessible.
yes @sylumer your guess is correct. I want to completely get rid of the due date ; manually, it means I want to uncheck the checkbox of date (and time btw) exactly like in this screenshot:
It seems the current reminders scripting object in Drafts does not allow this.
The workaround to delete the reminder and create a copy of it without the due date can only be manual. I think the scripting object in Drafts does not allow to delete an existing reminder.
My guess is more about how reminders works internally.
Agreed and is what I indicated previously.
True. It looks as though you can’t delete, but it is easy enough to mark it as complete which should be a viable alternative to deletion. Here’s an example that does that.
const list = ReminderList.findOrCreate("Test List");
let reminder = list.createReminder();
reminder.title = "Lorem Ipsum";
reminder.notes = "Foo Bar";
let dtToday = new Date();
reminder.dueDate = dtToday.add(1).day();
reminder.update();
alert("go check your reminders list");
aremIncomplete = list.incompleteTasks;
let reminderNew = list.createReminder();
reminderNew.title = aremIncomplete[0].title;
reminderNew.notes = aremIncomplete[0].notes;
reminderNew.update();
alert("go check your reminders list");
reminder.isCompleted = true;
reminder.update();
alert("go check your reminders list");
Should you need to ensure that the task does not appear on a list after deletion, you could also move it off to a special trash list that you can exclude.