ForumsTips & TricksTotal Estimated Lengths by Subtotal or Category


Total Estimated Lengths by Subtotal or Category
Author Message
Fred_Foote

Posted: Oct 04, 2010
Score: 0 Reference
If you highlight the javascript below and drag it to your Safari bookmark bar (and then give this bookmarklet a name), then after any sort in Toodledo you can see how long the subtotals will take per subtotal. For instance, if you sort by Tag (and if the tag names are A, B, C and D, then clicking on your new bookmarklet will tell you how long you've estimated it will take -- in total -- for each Tag. Hope this is clear!

javascript:var%20o=0;var%20o2='';var%20o3=0;var%20s='';var%20sd='';var%20myto=0;var%20it='';var%20v= 0;var%20d=document.body.innerHTML;var%20c=document.getElementsByClassName('sep');for(i=0;i<c.leng th;i++){if(i+1==c.length){myto=9999999;}%20else%20{myto=d.indexOf(c[i+1].innerHTML);}s=d.substring(d .indexOf(c[i].innerHTML),myto);%20sd=s.match(/len[^>]+>([^<]+)<\/span>/ig);for(j=0;j<sd.len gth;j++){if(sd[j].indexOf('none')%20<%201){%20sd[j].match(/(\d*\.?\d+)%20min|(\d*\.?\d+)%20hour/i );o=o+(isNaN(RegExp.$1)?0:RegExp.$1-0)+((isNaN(RegExp.$2)?0:RegExp.$2-0)*60);}};if(typeof%20c[i].inn erText=='undefined'){it=c[i].textContent;}else{it=c[i].innerText;}v=(o-0)/60;o2=o2+it+'%20-%20'+Math .floor(v)+'%20hours and '+Math.round((v-Math.floor(v))*60)+' minutes\n';o3=o3+v;o=0;};d=new%20Date();var%20o5=d.getHours()+':'+('0'+d.getMinutes()).slice(-2);d.s etMinutes(d.getMinutes()+(o3*60));var%20o4=d.getHours()+':'+('0'+d.getMinutes()).slice(-2);alert(o2+ '\nTotal%20Estimated%20Lengths:%20'+Math.floor(o3)+'%20hours and '+Math.round((o3-Math.floor(o3))*60)+' minutes\n\nCurrent%20time%20-%20'+o5+'\nEnd%20time%20-%20'+o4);


Thanks to atsushi.hirata for the original code. Thanks to Eric Tucker of First National Bank of America for modifying it.


This message was edited Oct 04, 2010.
You cannot reply yet

U Back to topic home

R Post a reply

To participate in these forums, you must be signed in.