title: Was a java.time.LocalDate in last week?
body: <p>I have a weekly statistics system, and I want to check if the last time the statistic was updated was last week. If it was, I want to clear it.</p>
  
  <p>At the moment, the date is stored in a <a href="http://docs.oracle.com/javase/8/docs/api/java/time/LocalDate.html" rel="nofollow"><code>LocalDate</code></a>:</p>
  
  <pre><code>LocalDate lastUpdate;
  </code></pre>
  
  <p>I already have the daily statistic working like this:</p>
  
  <pre><code>if(lastUpdate.isBefore(LocalDate.now())
  {
      clearDailyStatistics();
  }
  </code></pre>
  
  <p>And I'd like to do something like this:</p>
  
  <pre><code>if(/* something here? */)
  {
      clearWeeklyStatistics();
  }
  </code></pre>
  
  <p>So, the question is: <em>How do I compare the weeks of <code>LocalDate</code> objects?</em> There is no need for different "standards" of how week is formed - Monday through Sunday will be used (as is already used by Java's <code>DayOfWeek</code> class).</p>
  
  <p>Please, keep your comments and answers only about Java 8 <a href="http://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html" rel="nofollow">java.time</a> classes, no <a href="http://www.joda.org/joda-time/" rel="nofollow">Joda-Time</a> or other external libraries.</p>