Skip to content

Instantly share code, notes, and snippets.

@jsmm
Created October 23, 2013 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jsmm/7128250 to your computer and use it in GitHub Desktop.
Save jsmm/7128250 to your computer and use it in GitHub Desktop.
javascript:(function(){clip%20=%20window.getSelection();%20url%20=%20location.href;%20var%20currentdate%20=%20new%20Date();%20var%20weekdayNames%20=%20new%20Array("Sunday",%20"Monday",%20"Tuesday",%20"Wednesday",%20"Thursday",%20"Friday",%20"Sat");%20var%20weekday%20=%20weekdayNames[currentdate.getDay()];%20var%20brackets%20=%20"[[";%20%20var%20myDate%20=%20new%20Date();%20%20var%20year%20=%20myDate.getFullYear();%20var%20month%20=%20myDate.getMonth();%20if(month%20<=%209)%20%20%20%20%20month%20=%20'0'+month;%20var%20day=%20myDate.getDate();%20if(day%20<=%209)%20%20%20%20%20day%20=%20'0'+day;%20var%20prettyDate%20=%20year%20+'-'+%20month%20+'-'+%20day;%20var%20minutes%20=%20myDate.getMinutes();%20if(minutes%20<=%209)%20minutes%20=%20'0'%20+%20minutes;%20%20%20var%20hours%20=%20myDate.getHours();%20if(hours%20<=%209)%20hours%20=%20'0'%20+%20hours;%20%20%20theFinalString%20=%20clip%20+%20"%20("%20+%20url%20+%20"%20-%20"%20+%20brackets%20+%20prettyDate%20+%20"]]%20"%20+%20weekday%20+%20",%20"%20+%20hours%20+%20":"%20+%20minutes%20+%20")";%20prompt('Copy%20text%20to%20clipboard',theFinalString);}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment