<commit_before>import React from 'react'
import { connect } from 'react-redux'
import momentPropTypes from 'react-moment-proptypes'

import moment from 'moment'

import styles from './styles.scss'

const WIDTH = 82

export class CurrentTimeIndicator extends React.Component {
  constructor(props) {
    super(props)
    this.updateCalculatedStyle = this.updateCalculatedStyle.bind(this)

    this.updateCalculatedStyle()
  }

  calculateOffset() {
    const now = moment()
    const hour = now.hour()
    const minutes = now.minutes()
    return WIDTH * (hour + (minutes / 60))
  }
  updateCalculatedStyle() {
    this.state = { calculatedStyle: { left: this.calculateOffset() } }
  }

  componentDidMount() {
    const intervalId = setInterval(() => {
      this.updateCalculatedStyle()
    }, 60000)
    this.setState({ intervalId })
  }

  componentWillUnmount() {
    clearInterval(this.state.intervalId)
  }

  render() {
    let rendered = null
    const calculatedStyle = this.state.calculatedStyle
    if (this.props.selectedDate.isSame(moment(), 'day')) {
      rendered = <div
        className={styles.currentTimeIndicator}
        style={calculatedStyle}
      />
    }
    return rendered
  }
}

CurrentTimeIndicator.propTypes = {
  selectedDate: momentPropTypes.momentObj.isRequired,
}
<commit_msg>fixed stupid thing I broke when moving code out of constructor<commit_after>import React from 'react'
import { connect } from 'react-redux'
import momentPropTypes from 'react-moment-proptypes'

import moment from 'moment'

import styles from './styles.scss'

const WIDTH = 82

export class CurrentTimeIndicator extends React.Component {
  constructor(props) {
    super(props)
    this.updateCalculatedStyle = this.updateCalculatedStyle.bind(this)

    this.state = { calculatedStyle: this.calculatedStyle() }
  }

  calculateOffset() {
    const now = moment()
    const hour = now.hour()
    const minutes = now.minutes()
    return WIDTH * (hour + (minutes / 60))
  }
  calculatedStyle() {
    return { left: this.calculateOffset() }
  }
  updateCalculatedStyle() {
    this.setState({ calculatedStyle: this.calculatedStyle() })
  }

  componentDidMount() {
    const intervalId = setInterval(() => {
      this.updateCalculatedStyle()
    }, 60000)
    this.setState({ intervalId })
  }

  componentWillUnmount() {
    clearInterval(this.state.intervalId)
  }

  render() {
    let rendered = null
    const calculatedStyle = this.state.calculatedStyle
    if (this.props.selectedDate.isSame(moment(), 'day')) {
      rendered = <div
        className={styles.currentTimeIndicator}
        style={calculatedStyle}
      />
    }
    return rendered
  }
}

CurrentTimeIndicator.propTypes = {
  selectedDate: momentPropTypes.momentObj.isRequired,
}

{'fraction_non_alphanumeric': 0.11183496199782844, 'fraction_numerical': 0.006514657980456026, 'mean_word_length': 3.4943089430894307, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2398658', 'n_tokens_mistral': 851, 'n_tokens_neox': 815, 'n_words': 179}