Created
January 29, 2021 23:23
-
-
Save iaindooley/15aa879acd63d8915a03d89741e64809 to your computer and use it in GitHub Desktop.
Examples for Mauricio
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
//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