Last active
March 16, 2021 13:39
-
-
Save iaindooley/dcaa9d432bd5b7fbb6800bd16afa0a59 to your computer and use it in GitHub Desktop.
sumCardsWithMinutesSeconds
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
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