Skip to content

Instantly share code, notes, and snippets.

@jhyland87
Created March 21, 2017 23:32
Show Gist options
  • Save jhyland87/3d5902ce93b978d68afd0ccdba8384b4 to your computer and use it in GitHub Desktop.
Save jhyland87/3d5902ce93b978d68afd0ccdba8384b4 to your computer and use it in GitHub Desktop.
Convert the stupid "friendly" dates displayed by Atlassian to something useful
/**
* This changes the friendly timestamp display values in Atlassian from values like: Now, Today, Yesterday, n Hours Ago, etc
* Then changes the <time> tags to <span> tags (since <time> tags get updated every couple seconds)
*/
$( 'time' ).each(function( idx, elm ){
$( elm )
.text( new Date( $( elm ).attr( 'datetime' ) ).toGMTString() )
.replaceWith(function() {
return '<span>' + this.innerHTML + '</span>'
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment