Here you can find the source of getFirstWeekdayBetween(Date fromDate, Date toDate, int dayOfWeek)
public static Date getFirstWeekdayBetween(Date fromDate, Date toDate, int dayOfWeek)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getFirstWeekdayBetween(Date fromDate, Date toDate, int dayOfWeek) { Calendar aDay = Calendar.getInstance(); aDay.setTime(fromDate);/* www . j a v a 2s .c om*/ while (aDay.getTime().before(toDate)) { if (aDay.get(Calendar.DAY_OF_WEEK) == dayOfWeek) { return aDay.getTime(); } aDay.add(Calendar.DATE, 1); } return null; } }