Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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