Skip to content

Instantly share code, notes, and snippets.

@iaindooley
Last active March 16, 2021 13:39
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/dcaa9d432bd5b7fbb6800bd16afa0a59 to your computer and use it in GitHub Desktop.
Save iaindooley/dcaa9d432bd5b7fbb6800bd16afa0a59 to your computer and use it in GitHub Desktop.
sumCardsWithMinutesSeconds
var moved = new Notification(notification).movedCard();
var minutesum = 0;
var secondsum = 0;
var curlist = moved.currentList();
curlist.cards().each(function(card)
{
var timesplit = card.customFieldValue("Time").split(":");
if(timesplit.length > 1)
{
minutesum += parseInt(timesplit[0]);
secondsum += parseInt(timesplit[1]);
}
});
minutesum += Math.floor(secondsum/60);
secondsum = secondsum % 60;
curlist.cards().first().setName(minutesum+":"+secondsum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment