Skip to content

Instantly share code, notes, and snippets.

@kobake
Last active December 28, 2022 07:01
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 kobake/e30966480737754d608f to your computer and use it in GitHub Desktop.
Save kobake/e30966480737754d608f to your computer and use it in GitHub Desktop.
GitHub の「... days ago」みたいな所を日時表示に展開するブックマークレット ref: http://qiita.com/kobake@github/items/06dcc5b6135fd38adeb7
javascript:(function(){$('time').each(function(){var t = new Date($(this).attr('datetime'));var full = '';full += t.getFullYear() + '/';full += ('0' + (t.getMonth() + 1)).slice(-2) + '/';full += ('0' + t.getDate()).slice(-2) + ' ';full += ('0' + t.getHours()).slice(-2) + ':';full += ('0' + t.getMinutes()).slice(-2) + ':';full += ('0' + t.getSeconds()).slice(-2);$(this).text(full);});})();
$('time').each(function(){
var t = new Date($(this).attr('datetime'));
var full = '';
full += t.getFullYear() + '/';
full += ('0' + (t.getMonth() + 1)).slice(-2) + '/';
full += ('0' + t.getDate()).slice(-2) + ' ';
full += ('0' + t.getHours()).slice(-2) + ':';
full += ('0' + t.getMinutes()).slice(-2) + ':';
full += ('0' + t.getSeconds()).slice(-2);
$(this).text(full);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment