Skip to content

Instantly share code, notes, and snippets.

@spudtrooper
Created March 7, 2012 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spudtrooper/1993030 to your computer and use it in GitHub Desktop.
Save spudtrooper/1993030 to your computer and use it in GitHub Desktop.
Momentarily shows twitter time stamps as full dates.
<a href='javascript:(function(){function a(){var c=document.getElementsByClassName("js-short-timestamp");if(!c){return}for(var b in c){var d=c[b];if(!!d.getAttribute&&!!d.getAttribute("data-time")){d.innerHTML=d.parentNode.title}}}a()})();'>Show twitter dates</a>
/*
* Momentarily shows twitter time stamps as full dates.
*/
(function () {
function main() {
var spans = document.getElementsByClassName('js-short-timestamp');
if (!spans) return;
for (var i in spans) {
var sp = spans[i];
if (!!sp.getAttribute && !!sp.getAttribute('data-time')) {
// Get the nice date from the parent
sp.innerHTML = sp.parentNode.title;
}
}
}
main();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment