If i have this markup:
item 1
item 1>
Super simple with an array sort:
$("p").sort(function(a,b){
return new Date($(a).attr("data-date")) > new Date($(b).attr("data-date"));
}).each(function(){
$("body").prepend(this);
})
Reverse order (in case I misunderstood you) is as easy as flipping the greater than symbol
$("p").sort(function(a,b){
return new Date($(a).attr("data-date")) < new Date($(b).attr("data-date"));
}).each(function(){
$("body").prepend(this);
})