Blog Archive

Wednesday, 11 March 2009

Google Calendar Bookmarklet

The bookmarklet will add a new entry to google calendar, with the URL of the current open web page as the title, with today's date as the start/end date. It sets 20:00 as the start time and 21:00 as the end time:



javascript:function%20zeroPad(n,%20digits)%20{n%20=%20n.toString();while%20(n.length%20<%20digits)%20{n%20=%20'0'%20+%20n;}return%20n;}var%20now=new%20Date();%20var%20t=document.



location;void(window.open('http://www.google.com/calendar/event?text='+escape(t)+'&pprop=HowCreated:QUICKADD&action=TEMPLATE&dates='%20+%20now.getFullYear()%20+%20zeroPad(now.get



Month()+1,2)%20+%20zeroPad(now.getDate(),2)%20+%20'T'%20+%20'200000'%20+%20%20%20'/'%20+%20%20now.getFullYear()%20+%20zeroPad(now.getMonth()+1,2)%20+%20zeroPad(now.getDate(),2)%2



0+%20'T'%20+%20'210000'%20+%20'Z'));





Or drag this link to your bookmarks : Addit2GCal