Created
April 15, 2020 12:12
-
-
Save iaindooley/09e1acb1f0e601bc2c351e488a5bc040 to your computer and use it in GitHub Desktop.
Sort list numerically
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
function sortListNumerically(notification) | |
{ | |
new Notification(notification).movedCard().currentList().sort(function(card1,card2) | |
{ | |
var ret = 0; | |
if(parseInt(card1.name().toLowerCase()) > parseInt(card2.name().toLowerCase())) | |
ret = 1; | |
else if(parseInt(card1.name().toLowerCase()) < parseInt(card2.name().toLowerCase())) | |
ret = -1; | |
return ret; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment