<commit_before>import React, { PropTypes, Component } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import moment from 'moment';
import { connect } from 'react-redux';

import MatchModel from '../../models/MatchModel.js';
import { contextTypes } from '../../utils/decorators/withContext.js';

import Strike from '../controls/Strike.js';
import MatchCardHeader from './Match/MatchCardHeader.js';

@connect(state => {
  return {
    config: state.config,
    user: state.user,
    players: state.players,
    clubs: state.clubs,
    matches: state.matches,
    teams: state.teams,
  };
})
export default class Matches extends Component {
  static contextTypes = contextTypes;

  static propTypes = {
    config: PropTypes.object.isRequired,
    user: PropTypes.object.isRequired,
    matches: ImmutablePropTypes.listOf(PropTypes.instanceOf(MatchModel).isRequired).isRequired,
  }

  componentDidMount() {
    this.context.setTitle();
  }

  render() {
    // TODO: put in some global config (or perhaps server config?)
    const matchesToShow = 7;
    //const showFutureMatchesDays = 7;
    //const showPlayedMatchesDays = 20;

    var today = moment();
    //var yesterday = moment().subtract(1, 'days');  || cal.date.isSame(yesterday, 'day')
    var ownMatches = this.props.matches;

    var matchesToday = ownMatches.filter(cal => cal.date.isSame(today, 'day'));
    var matchesNext = ownMatches
      .filter(cal => cal.date.isAfter(today, 'day')) // && cal.date.diff(today, 'days') <= showFutureMatchesDays)
      .sort((a, b) => a.date - b.date)
      .take(matchesToShow);
    var matchesPlayed = ownMatches
      .filter(cal => cal.date.isBefore(today, 'day')) // && cal.date.diff(today, 'days') >= -showPlayedMatchesDays)<commit_msg>matches: show 10 tiles instead of 7<commit_after>import React, { PropTypes, Component } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import moment from 'moment';
import { connect } from 'react-redux';

import MatchModel from '../../models/MatchModel.js';
import { contextTypes } from '../../utils/decorators/withContext.js';

import Strike from '../controls/Strike.js';
import MatchCardHeader from './Match/MatchCardHeader.js';

@connect(state => {
  return {
    config: state.config,
    user: state.user,
    players: state.players,
    clubs: state.clubs,
    matches: state.matches,
    teams: state.teams,
  };
})
export default class Matches extends Component {
  static contextTypes = contextTypes;

  static propTypes = {
    config: PropTypes.object.isRequired,
    user: PropTypes.object.isRequired,
    matches: ImmutablePropTypes.listOf(PropTypes.instanceOf(MatchModel).isRequired).isRequired,
  }

  componentDidMount() {
    this.context.setTitle();
  }

  render() {
    // TODO: put in some global config (or perhaps server config?)
    const matchesToShow = 10;
    //const showFutureMatchesDays = 7;
    //const showPlayedMatchesDays = 20;

    var today = moment();
    //var yesterday = moment().subtract(1, 'days');  || cal.date.isSame(yesterday, 'day')
    var ownMatches = this.props.matches;

    var matchesToday = ownMatches.filter(cal => cal.date.isSame(today, 'day'));
    var matchesNext = ownMatches
      .filter(cal => cal.date.isAfter(today, 'day')) // && cal.date.diff(today, 'days') <= showFutureMatchesDays)
      .sort((a, b) => a.date - b.date)
      .take(matchesToShow);
    var matchesPlayed = ownMatches
      .filter(cal => cal.date.isBefore(today, 'day')) // && cal.date.diff(today, 'days') >= -showPlayedMatchesDays)
{'fraction_non_alphanumeric': 0.14470356841809498, 'fraction_numerical': 0.003933689238550154, 'mean_word_length': 3.678055190538765, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '6254635', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1104, 'n_words': 259}