title: how can I group in the frontend some data I get from the API? AngularJS
body: <p>started working not too long ago with angularJS so I still have some stuff I don't get.  </p>
  
  <p>Gonna try to be as simple as possible in the explanation, I'm working on small part of a bigger project, to get me going with angularJs, and I'm stuck on this.</p>
  
  <p>Is there a good way to do the following in the frontend without touching API/Database? </p>
  
  <p>I have an interface that returns me some data from the backend,
  When a user creates a new entry in the app, it registers the userID, activityID, the start date of the activity and the end date.
  So what I get is an array with some params like ID, startDate and endDate, </p>
  
  <pre><code>    activities [ 
      {id: 1, activityID: 5, startDate:1515628800000, endDate: 1515628800000},
      {id: 2, activityID: 4, startDate:1515628800000, endDate: 1515628800000}
      {id: 3, activityID: 8, startDate:1515628800000, endDate: 1515628800000},
      {id: 4, activityID: 2, startDate:1515628800000, endDate: 1515628800000},]
  </code></pre>
  
  <p>(start dates and end dates are the same just for example) </p>
  
  <p>I just need some help with the logic, if I can access this interface, and I have a function that takes as arguments 2 dates, one starting date and one ending date, and returns me the above array, with all the activities filtered by the range I put in the function, how can I order these data by weeks?</p>
  
  <p>What I mean is, if I do a </p>
  
  <pre><code>&lt;div class="tableRow" ng-repeat="t in vm.activitiesData.activities"&gt;
  </code></pre>
  
  <p>(<code>activitiesData.activities</code> this is the already filtered interface, with only entries for january in this case),</p>
  
  <p>Currently this returns me X Divs depending on how many activities there are.</p>
  
  <p>What I want to achieve, is to return somehow for the filtered activities in January, 5 DIVS representing each week in january, and inside those divs, the data divided by week.</p>
  
  <p>So I would need to come up with an ng-repeat that creates a DIV for a week, if there is data in that week.</p>
  
  <p>If my actual result with the ng-repeat above is:  </p>
  
  <pre><code>Activity 1
  Activity 2
  Activity 3
  Activity 4
  </code></pre>
  
  <p>I want to get</p>
  
  <pre><code>Week 1
    Activity 3
  Week 2
    Activity 4
    Activity 1
  Week 4
    Activity 2
  </code></pre>
  
  <p>is this possible without touching the backend? As I said before, all that I can get now is an array of activities within a specific month, but need to figure out how to sort them in weeks while I use a ng-repeat to generate the data in the view.</p>
  
  <p>Hope it s clear what Im  trying to do, sorry for the confusion, thank you</p>
  
  <p>edit: divs structure for my table:</p>
  
  <pre><code>&lt;div class="activityTable" ng-repeat="t in vm.activitiesData.activities"&gt;
  &lt;div class="activityHeaderContent"&gt; Week 01 &lt;/div&gt;
  &lt;!-- this is the header with the week number, now all the data for that week should be put in the next div --&gt;
  
  &lt;div class="activityRowContent" ng-repeat="nested ng repeat goes here"&gt; Activity 1 &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>so the result I want, is if we keep the previous example, where it generates 3 weeks and puts the activity in the respective week, to show 3 different DIVs, with the titles Week 1, Week 2, Week 4, and group those activities based on their start/end date in the correct Week</p>