【发布时间】:2020-11-25 19:20:49
【问题描述】:
我有一个 ArrayList“列表”
Receipts{
int invoice;
String date;
double amount;
....
}
我想将列表排序到日期之间。
public List<Receipts> sortListByDate(String date1,String date2,List<Receipts> receipts){
List<Receipts> sortedList = new ArrayList<>();
// if receipts.date() is between(or including) date1 and date2 then sortedList.add(that object)
return sortedList;
}
receipt.date() , date1 和 date2 的格式为 String "dd-MM-yyyy"
帮我排序【完成“sortListByDate”功能】
【问题讨论】:
-
你有什么问题?
-
如何将数组列表排序到两个日期之间?
-
“排序”实际上是指“过滤器”吗?还是真的需要排序?
标签: java android date sorting arraylist