Skip to content

Instantly share code, notes, and snippets.

@jezinka
Created March 6, 2017 13:42
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 jezinka/5ca59ea255ca1d7f7b3c107e74722f67 to your computer and use it in GitHub Desktop.
Save jezinka/5ca59ea255ca1d7f7b3c107e74722f67 to your computer and use it in GitHub Desktop.
private Date getSaturdayDate(Date date) {
Calendar calendarInstance = Calendar.getInstance();
calendarInstance.setTime(date);
if (calendarInstance.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
return date;
}
return new Date();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment