This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// listsToClear: defines the iOS reminders list(s) from which completed reminders will be removed. Additional lists can be added to this this array if you wish. | |
let listsToClear = ["Completed Archive"] | |
for ( j = 0; j < listsToClear.length; j++ ) { | |
let reminderList = listsToClear[j] | |
let cal = await Calendar.forRemindersByTitle( reminderList ) | |
let reminders = await Reminder.all( [cal] ) | |
for( var i = 0; i < reminders.length; i++ ) { | |
let reminder = reminders[i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// days: specifies the number of days that a reminder will remain marked as complete before it is moved to the "Completed Archive" list. | |
let days = 7 | |
let today = new Date() | |
let arch = await Calendar.forRemindersByTitle("Completed Archive") | |
let listsToClear = await Calendar.forReminders() | |
for ( var j = 0; j < listsToClear.length; j++ ) { | |
let cal = listsToClear[j] | |
let reminders = await Reminder.allCompleted( [cal] ) |