Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Created January 29, 2021 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaindooley/15aa879acd63d8915a03d89741e64809 to your computer and use it in GitHub Desktop.
Save iaindooley/15aa879acd63d8915a03d89741e64809 to your computer and use it in GitHub Desktop.
Examples for Mauricio
//when a card in list "PRAY TODAY" is moved into list "WAITING", add comment "Prayed on day {datenumber}, at {time24}."
function prayedToday(notification)
{
var notif = new Notification(notification);
var moved = notif.movedCard(/WAITING.*/i);
if(/PRAY TODAY.*/i.test(notif.listBefore().name()))
{
moved.postComment("Prayed on day "+Trellinator.now().getDate()+" at "+Trellinator.now().stringFormat("HH:MM"));
}
}
//when a card with a name containing " [{*}]" is moved into list "WAITING", set due in {cardnamewildcard1} days
function setDueInWaiting(notification)
{
var moved = new Notification(notification).movedCard(/WAITING.*/i);
if(parts = /.* \[(.+)\].*/.exec(moved.name()))
{
moved.setDue(new Date(parts[1]));//assumes format of date in name can be passed into the Date constructor
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment