title: Splitting data by week
body: <p>I have a data object that has a timestamp:</p>
  
  <pre><code>class MyDataObject
  {
      public DateTime timestamp { get; set; }
      public int value { get; set; }
  
      public MyDataObject(DateTime timestamp, int value)
      {
          this.timestamp = timestamp;
          this.value = value;
      }
  }
  </code></pre>
  
  <p>In the main method, I create a lot of these data objects over the timespan of 18 days (2.5 weeks):</p>
  
  <pre><code>    static void Main(string[] args)
      {
          List&lt;MyDataObject&gt; data = new List&lt;MyDataObject&gt;();
  
          data.Add(new MyDataObject(DateTime.Now, 1));
          data.Add(new MyDataObject(DateTime.Now.AddDays(2), 1));
          data.Add(new MyDataObject(DateTime.Now.AddDays(4), 1));
          data.Add(new MyDataObject(DateTime.Now.AddDays(6), 1));
          data.Add(new MyDataObject(DateTime.Now.AddDays(8), 1));
          data.Add(new MyDataObject(DateTime.Now.AddDays(10), 1));
          data.Add(new MyDataObject(DateTime.Now.AddDays(12), 1));
          data.Add(new MyDataObject(DateTime.Now.AddDays(14), 1));
          data.Add(new MyDataObject(DateTime.Now.AddDays(18), 1));
      }
  </code></pre>
  
  <p>I need to divide this data by weeks, so that the data between days 1 to 6 need to be placed in an array, data between days 8 to 14 in another, and the one in day 18 goes in another array all by itself.</p>
  
  <p>I need to create a 2D List of some sort and somehow divide the data in an "array of arrays" but I'm stumped. I suspect I need to use List.FindAll but I've never used it before and have no idea how I can use it in this case. </p>