import React from 'react';
import Accordion from 'react-bootstrap/Accordion';
import Card from 'react-bootstrap/Card';
import Activity from './activity';
import * as activityFns from './activityfns';
import * as utils from '../Utils/utils.js'

class ActivityDay extends React.Component {
  /** @inheritdoc */
  constructor(props) {
    super(props);
    this.state = {
      date: props.date, 
      activities: Array.from(props.activities).sort(activityFns.compareActivities)
    };
  }

  /** @inheritdoc */
  render() {
    let date = new Date(this.props.date);
    let id = date.getTime();
    return (
      <Card>
        <Accordion.Toggle as={Card.Header} eventKey="0" align="center" >
          {utils.timestampToDateFormatted(date.getTime())}
        </Accordion.Toggle>
        <Accordion.Collapse eventKey="0">
          <Card.Body>
            {this.state.activities.map((activity, index) => (
            <Activity activity={activity} key={index + id}/>
            ))}
          </Card.Body>
        </Accordion.Collapse>
      </Card>
    );
  }
}

export default ActivityDay;

@@ -349,57 +349,62 @@
 ;%0A  
-  this.state = %7B%0A      date: props.date, %0A      a
+%7D%0A%0A  /** @inheritdoc */%0A  render() %7B%0A    const sortedA
 ctiv
@@ -412,9 +412,10 @@
 ties
-:
+ =
  Arr
@@ -422,16 +422,21 @@
 ay.from(
+this.
 props.ac
@@ -444,16 +444,27 @@
 ivities)
+%0A          
 .sort(ac
@@ -495,54 +495,9 @@
 ies)
-%0A    %7D;%0A  %7D%0A%0A  /** @inheritdoc */%0A  render() %7B
+;
 %0A   
@@ -831,20 +831,15 @@
    %7B
-this.state.a
+sortedA
 ctiv

Remove state variable where it can be removed.