Created
September 30, 2015 17:00
-
-
Save kimmellj/a450f6304357b36c6cc1 to your computer and use it in GitHub Desktop.
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 regex = /\d+/g; | |
var hourCount = 0; | |
jQuery("td.timeoriginalestimate").each(function(){ | |
var origTime = jQuery(this).text(); | |
if (origTime.indexOf("hours") > -1) { | |
var results = regex.exec(origTime); | |
if (results) { | |
var numresults = results.length; | |
for (var i = 0; i < numresults; i++) { | |
var result = results[i]; | |
hourCount += parseFloat(result); | |
} | |
} | |
} | |
if (origTime.indexOf("days") > -1) { | |
var results = regex.exec(origTime); | |
if (results) { | |
var numresults = results.length; | |
for (var i = 0; i < numresults; i++) { | |
var result = results[i]; | |
hourCount += (8 * parseFloat(result)); | |
} | |
} | |
} | |
}); | |
console.log("Total Development time: "+hourCount); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment