You have missed $
, So instead of
var $eachblocks = (".top10_month .periods");
Use
var $eachblocks = $(".top10_month .periods");
Additionally, You should use .data()
instead of .attr()
So instead of
var sortvalue = $this.attr("data-date");
use
var sortvalue = $this.data("date");
You should go thorough jQuery Data vs Attr?