Skip to content

Instantly share code, notes, and snippets.

@mneil
Created February 13, 2015 00:24
Show Gist options
  • Save mneil/044bf07cc4fa9b237ac7 to your computer and use it in GitHub Desktop.
Save mneil/044bf07cc4fa9b237ac7 to your computer and use it in GitHub Desktop.
Muut modify display time for FF and Chrome
(function(){
MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
function time(target){
target.innerHTML = target.time;
}
moot("format", function(body, post) {
var $ = jQuery;
var $post = $(body).parents('.m-post')[0];
var t = $(".m-time", $post)[0];
//alternatively you can manipulate post.time into a datetime you want
t.time = $(".m-tooltip", $post).text();
new MutationObserver(function(mutations) {
time(mutations[0].target);
}).observe(t, {
subtree: true,
attributes: true
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment