refactor sorting for date, add class "asc" or "dsc" for reverse