title: Get the week start and end date given a current date and week start
body: <p>If possible I would prefer a joda or non-joda solution for the scenario below</p>
  
  <p>Lets say if my week starts on 02/05/2012 and the given current date is 02/22/2011. I need to calculate the week start and end date for the given current date. So my solution should have the week start as 02/19 and week ends at 02/25.
  For simplicity, I have set my week start here as 02/05/2011 but it could be any day potentially and my week always has 7 days.</p>
  
  <p>My existing code is below but doesnt seem to work as expected.</p>
  
  <pre><code>public Interval getWeekInterval(Date calendarStartDate, Date date)
  {
      Calendar sDate = Calendar.getInstance();
      sDate.setTime(getMidnightDate(calendarStartDate));
  
      Calendar eDate = Calendar.getInstance();
      eDate.setTime(date);
  
      Calendar weekStartDate = (Calendar) sDate.clone();
      logger.debug("Date:" + sDate.getTime());
      while (sDate.before(eDate)) {
          weekStartDate = sDate;
          sDate.add(Calendar.DAY_OF_WEEK_IN_MONTH, 1);
      }
  
      return new Interval(weekStartDate.getTime(), sDate.getTime());
  }
  </code></pre>