Skip to content

Instantly share code, notes, and snippets.

@john-evangelist
Created May 20, 2014 17:35
Show Gist options
  • Save john-evangelist/aad0ce5b1498f117951c to your computer and use it in GitHub Desktop.
Save john-evangelist/aad0ce5b1498f117951c to your computer and use it in GitHub Desktop.
public static Date doParse(String toParse) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yyyy");
try {
return simpleDateFormat.parse(toParse);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
public static List<Venda> doFilter(Date dateInicial, Date dateFinal, List<Venda> incommingVendas) {
List<Venda> vendas = new ArrayList<Venda>();
for (Venda v : incommingVendas) {
if (v.getData().after(dateInicial) && v.getData().before(dateFinal)) {
vendas.add(v);
}
}
return vendas;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment