Skip to content

Instantly share code, notes, and snippets.

@nurv
Created July 17, 2018 15:45
Show Gist options
  • Save nurv/ef24e1edac85e5b8f8c81bce47001389 to your computer and use it in GitHub Desktop.
Save nurv/ef24e1edac85e5b8f8c81bce47001389 to your computer and use it in GitHub Desktop.
$(".episodecell").toArray().sort((a,b) => {
var arr = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var date = $(".caption2.singleline", a)[1].innerHTML.replace(/^\s+|\s+$/, "").split("•")[0];
var resa = arr.indexOf(date.substr(0,3))*100 + parseInt(date.substr(4));
var date = $(".caption2.singleline", b)[1].innerHTML.replace(/^\s+|\s+$/, "").split("•")[0];
var resb = arr.indexOf(date.substr(0,3))*100 + parseInt(date.substr(4));
return resa - resb;
}).map(X => {
$("h2:contains('All Active Episodes')").after(X);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment