<commit_before>'use strict';

import React from 'react';
import { Link } from 'react-router';

class Week extends React.Component {
  constructor() {
    super();

    this.checkDayForEvent = this.checkDayForEvent.bind(this);
    this.todaysEvents = this.todaysEvents.bind(this);
  }
  checkDayForEvent(day) {
    var date = day.format("MMDDYYYY");
    if(this.props.events.length){
      var events = this.props.events.reduce((el) => {
        return el.date === date;
      });
      return events.length;
    }
    return 0;
  }

  todaysEvents(day) {
    var number = this.checkDayForEvent(day);
    if(number) {
      return (
        <div className="ui label">
          <i className="certificate icon"></i>{number}
        </div>
      )
    }
    return null;
  }

  render() {
    var days = [];
    var date = this.props.date;
    var month = this.props.month;

    for (var i=0; i<7; i++) {
      var day = {
        name: date.format("ddd"),
        number: date.date(),
        isCurrentMonth: date.month() === month.month(),
        isToday: date.isSame(new Date(), "day"),<commit_msg>Calendar displays events<commit_after>'use strict';

import React from 'react';
import { Link } from 'react-router';

class Week extends React.Component {
  constructor() {
    super();

    this.checkDayForEvent = this.checkDayForEvent.bind(this);
    this.todaysEvents = this.todaysEvents.bind(this);
  }
  checkDayForEvent(day) {
    var date = day.format("MMDDYYYY");
    if(this.props.events.length){
      var events = this.props.events.filter((el) => {
        return el.date === date;
      });
      return events.length;
    }
    return 0;
  }

  todaysEvents(day) {
    var number = this.checkDayForEvent(day);
    if(number) {
      return (
        <div className="ui label right">
          <i className="certificate icon"></i>{number}
        </div>
      )
    }
    return null;
  }

  render() {
    var days = [];
    var date = this.props.date;
    var month = this.props.month;

    for (var i=0; i<7; i++) {
      var day = {
        name: date.format("ddd"),
        number: date.date(),
        isCurrentMonth: date.month() === month.month(),
        isToday: date.isSame(new Date(), "day"),
{'fraction_non_alphanumeric': 0.15349887133182843, 'fraction_numerical': 0.002708803611738149, 'mean_word_length': 2.4517133956386292, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3277238', 'n_tokens_mistral': 728, 'n_tokens_neox': 717, 'n_words': 156}