Skip to content

Instantly share code, notes, and snippets.

@thom4parisot
Created October 18, 2012 07:30
Show Gist options
  • Save thom4parisot/3910293 to your computer and use it in GitHub Desktop.
Save thom4parisot/3910293 to your computer and use it in GitHub Desktop.
Freshbooks Invoice Total Hours
$('.invbody-items:first tbody tr').map(function(){
return parseInt($(this).find('td:eq(3)').text().trim(), 10);
}).get().reduce(function(left, right){
return (left || 0) + (right || 0);
}); // total hours as a number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment