<commit_before>import React from 'react';
import { queries } from './../helpers';
import { graphql, compose, gql } from 'react-apollo';
import { Link } from 'react-router-dom';
import { List, ListItem } from 'material-ui/List';
import Badge from 'material-ui/Badge';
import style from './../style.css';
import { RaisedButton } from 'material-ui';

const subTitleString = (text, limit) => {
  if (text.length > limit) return text.substring(0, limit);
  return text;
};
class listCoferences extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      openToggle: false,
      openDialog: false,
      selectElement: 0,
    };
    this.handleSwitch = this.handleSwitch.bind(this);
  }

  async handleSwitch(conference_id) {
    await this.props.SWITCH_CURRENT_CONFERENCE({
      variables: {
        conference_id: conference_id,
      },
      refetchQueries: [
        {
          query: ME_QUERY,
        },
      ],
    });
  }

  render() {
    console.log(this.props);
    const { loading } = this.props.data;
    if (loading) return <div>loading...</div>;

    const conferences = this.props.data.getConferenceByUserID;
    console.log(conferences);
    return (
      <div className="list-dashboard">
        <style dangerouslySetInnerHTML={{ __html: style }} />
        <center className="list-conf">
          MY LIST CONFERENCES
          <Badge
            badgeContent={conferences.length}
            primary={true}
            className="icon-conference"
          />
        </center>
        <List>
          {conferences.map(conference => {
            return (
              <ListItem
                key={conference.id}
                primaryText={conference.title}
                className="listitem-conf"
                secondaryText={
                  subTitleString(conference.start_date, 10) +
                  '  To  ' +
                  subTitleString(conference.start_date, 10)
                }
                containerElement={<Link to={`/conference/info`} />}
                onClick={async () => {
                  // clg;
                  await this.handleSwitch(conference.id);
                  window.location.reload();
                }}
              />
            );
          })}
          <RaisedButton
            label="Create new conference"
            fullWidth={true}
            primary={true}
            containerElement={<Link to={`/conference/add`} />}
          />
        </List>
      </div>
    );<commit_msg>Fix render date<commit_after>import React from 'react';
import { queries } from './../helpers';
import { graphql, compose, gql } from 'react-apollo';
import { Link } from 'react-router-dom';
import { List, ListItem } from 'material-ui/List';
import Badge from 'material-ui/Badge';
import style from './../style.css';
import { RaisedButton } from 'material-ui';

const subTitleString = (text, limit) => {
  if (text.length > limit) return text.substring(0, limit);
  return text;
};
class listCoferences extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      openToggle: false,
      openDialog: false,
      selectElement: 0,
    };
    this.handleSwitch = this.handleSwitch.bind(this);
  }

  async handleSwitch(conference_id) {
    await this.props.SWITCH_CURRENT_CONFERENCE({
      variables: {
        conference_id: conference_id,
      },
      refetchQueries: [
        {
          query: ME_QUERY,
        },
      ],
    });
  }

  render() {
    console.log(this.props);
    const { loading } = this.props.data;
    if (loading) return <div>loading...</div>;

    const conferences = this.props.data.getConferenceByUserID;
    console.log(conferences);
    return (
      <div className="list-dashboard">
        <style dangerouslySetInnerHTML={{ __html: style }} />
        <center className="list-conf">
          MY LIST CONFERENCES
          <Badge
            badgeContent={conferences.length}
            primary={true}
            className="icon-conference"
          />
        </center>
        <List>
          {conferences.map(conference => {
            return (
              <ListItem
                key={conference.id}
                primaryText={conference.title}
                className="listitem-conf"
                secondaryText={
                  subTitleString(conference.start_date, 10) +
                  '  To  ' +
                  subTitleString(conference.end_date, 10)
                }
                containerElement={<Link to={`/conference/info`} />}
                onClick={async () => {
                  // clg;
                  await this.handleSwitch(conference.id);
                  window.location.reload();
                }}
              />
            );
          })}
          <RaisedButton
            label="Create new conference"
            fullWidth={true}
            primary={true}
            containerElement={<Link to={`/conference/add`} />}
          />
        </List>
      </div>
    );
{'fraction_non_alphanumeric': 0.12619808306709265, 'fraction_numerical': 0.0023961661341853034, 'mean_word_length': 1.7719977863862757, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 39, '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': '1080253', 'n_tokens_mistral': 1427, 'n_tokens_neox': 1386, 'n_words': 266}