Due to Codename One not implementing the full Java API, is there another working way of sorting List of Dates?
I've tried below, both of which failed to compile.
datesList.sort(Date::compareTo); // Failed
error: invalid method reference datesList.sort(Date::compareTo);
// Failed
Collections.sort(datesList, new Comparator<Date>(){
public int compare (Date d1, Date d2){
return d1.compareTo(d2);
}
});
error: cannot find symbol return d1.compareTo(d2);
The same issue with getting the last day of the month with below:
cal.getActualMaximum(Calendar.DATE);
error: cannot find symbol cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));