Collections.sort(saleList, new Comparator<DbViewProductSale>() {
@Override
public int compare(DbViewProductSale paramT1, DbViewProductSale paramT2) {
// return paramT1.getSaleDate().before(paramT2.getSaleDate()) ? -1 : 1;
return paramT1.getSaleDate().compareTo(paramT2.getSaleDate());
}
});
ref : http://blog.csdn.net/ghsau/article/details/42012365