import Event from './event';

const Day = ({ events }) => {

  let id = 0;
  let eventList = [];

  for (let e of events) {
    eventList.push(<Event info={e} key={id}/>);
    id++;
  }

  let dayNames = [ 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag', 'Søndag' ];
  let monthNames = [ 'januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember' ];

  let dayString = dayNames[ events[ 0 ].start_time.getDay() ] + ' ' + events[ 0 ].start_time.getDate() + '. ' + monthNames[ events[ 0 ].start_time.getMonth() ];

  return (
    <div>
      <h2>{dayString}</h2>
      {eventList}
      <br />
    </div>
  );
};

export default Day;

@@ -422,24 +422,38 @@
 %0A%0A  
-let dayString = 
+return (%0A    %3Cdiv%3E%0A      %3Ch2%3E%7B
 dayN
@@ -594,51 +594,8 @@
 ) %5D;
-%0A%0A  return (%0A    %3Cdiv%3E%0A      %3Ch2%3E%7BdayString
 %7D%3C/h

Move dayString definition into return directly