ForumsTips & TricksBookmarklet : Display the length by items and end time for tasks


Bookmarklet : Display the length by items and end time for tasks
Author Message
atu.hira

Posted: Mar 25, 2010
Score: 0 Reference
Everyone,

It's a Bookmarklet that you can see length by sort items (for example, context) and end time for complete tasks
,using JavaScript alert.

Please try it out. :)

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



This message was edited Mar 25, 2010.
Rich

Posted: Mar 26, 2010
Score: 0 Reference
Cool thanks for posting
Fred_Foote

Posted: Mar 30, 2010
Score: 0 Reference
Can you do one for "Priority"? That would be great -- sorry I don't know how to write these myself.
atu.hira

Posted: Mar 31, 2010
Score: 0 Reference
Yes, It works as you wish.
Just click the column heading labeled "Priority" to sort by priority, and then run the Bookmarklet.
Fred_Foote

Posted: Apr 01, 2010
Score: 0 Reference
Sorry, not sure how to run Bookmarklets. Read something about it but I'm still not sure how it works. Any easy tips -- I'm fairly good with new stuff. Thanks!

UPDATE: Figured it out -- highlighted your Bookmarklet, dragged it to Bookmarks bar, gave it a name ("Atsushi Special") and now I can "run" it when in Toodledo. Thanks!


This message was edited Apr 01, 2010.
Fred_Foote

Posted: Apr 02, 2010
Score: 0 Reference
Atsushi,

Works swell! May I be so bold as to ask if the bookmarklet could be modified so that the final result is expressed in hours and minutes rather than just hours? In other words,

1 hour, 40 minutes (preferred)

instead of

1.67 hours (currently)

Am I being presumptuous on your time, or what?!! Thanks for giving it a thought, anyway.


This message was edited Apr 02, 2010.
You cannot reply yet

U Back to topic home

R Post a reply

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