Skip to content

Instantly share code, notes, and snippets.

View MacularDegenerate's full-sized avatar

MacularDegenerate

View GitHub Profile
@MacularDegenerate
MacularDegenerate / gist:466f7446176ba93708a1725cb6ef1a06
Created July 23, 2019 05:24
Delete all Reminders from the "Completed Archive" list
// 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]
@MacularDegenerate
MacularDegenerate / gist:8ed1ea4c9f0c5ddd9eb6d69e1935df64
Created July 23, 2019 05:19
Archive completed Reminders greater than 7 days old
// 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] )