title: how to determine whether the date of this week or last?
body: <p>I have date array. For example 10 dates. I need calculate each date - it is this week or last week. How do make this?</p>
  
  <pre><code>private List&lt;Receipt&gt; getSectionPosition(List&lt;Receipt&gt; receiptList){
         List&lt;Receipt&gt; list = new ArrayList&lt;&gt;();
         Date now = new Date();
          for (int i = 0; i&lt;receiptList.size(); i++){
              if (receiptList.get(i).getCreatedDate().compareTo(now)==0){
                  list.add(receiptList.get(i));
              }
          }
         return list;
      }
  </code></pre>
  
  <p>i pass <code>List&lt;Receipt&gt;</code> and if receipt has date on this week i add it in new list. but it is not work.</p>