Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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