code: public Date getFirstDateInCalendar(Date dateTarget)
      {
          // Now get the first box on the calendar
          int iFirstDayOfWeek = calendar.getFirstDayOfWeek();
          calendar.setTime(dateTarget);
          int iTargetDayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
          int iOffset = -Math.abs(iTargetDayOfWeek - iFirstDayOfWeek);
          calendar.add(Calendar.DATE, iOffset);
  
          calendar.set(Calendar.HOUR_OF_DAY, 0);
          calendar.set(Calendar.MINUTE, 0);
          calendar.set(Calendar.SECOND, 0);
          calendar.set(Calendar.MILLISECOND, 0);
  
          return calendar.getTime();
      }
docs: Given the first date of the calendar, get the first date of that week.
  @param dateTarget A valid date.
  @return The first day in the week (day of week depends on Locale).