Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created February 11, 2014 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marti1125/8939744 to your computer and use it in GitHub Desktop.
Save marti1125/8939744 to your computer and use it in GitHub Desktop.
obtener solo los sabados
List<LocalDate> soloSabados = new ArrayList<LocalDate>();
int diferenciaDias = Days.daysBetween(new LocalDate(desde), new LocalDate(hasta)).getDays();
for(int i = 0; i <= diferenciaDias; i++) {
if(new LocalDate(desde).plusDays(i).getDayOfWeek() == 6){
soloSabados.add(new LocalDate(desde).plusDays(i));
}
}
System.out.println(soloSabados);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment