<commit_before>import React from 'react'
import { formatDateWithWords, formatDate } from '/imports/client/utils/format'
import { findNextEvent, calibrateEndWeekday } from '/imports/client/utils/findNextEvent'
import './styles.scss'

const HoursFormatted = ({ data }) => {
  const {
    startingDate,
    endingDate,
    startingTime,
    endingTime
  } = data

  const isSameDay = startingDate.toDateString() === endingDate.toDateString()

  if (data.multipleDays) {
    const isEnding = !!endingDate

    return (
      <div className='hours-formatted multiple-days'>
        {isEnding && (
          <div className='date'>
            {formatDateWithWords(startingDate)} - {formatDateWithWords(endingDate)}
          </div>
        )}

        {data.days.map((day, index) => (
          (day && day.day) &&
          <div key={index} className='day'>
            <div>{day.day.substr(0, 3)}</div>
            <span>{day.startingTime} - {day.endingTime}</span>
          </div>
        ))}
      </div>
    )
  }

  if (data.repeat) {
    const {
      days,
      every,
      forever,
      type,
      until,
      occurences,
      monthly,
      recurrenceEndDate
    } = data.recurring
<commit_msg>return before using null endingDate<commit_after>import React from 'react'
import { formatDateWithWords, formatDate } from '/imports/client/utils/format'
import { findNextEvent, calibrateEndWeekday } from '/imports/client/utils/findNextEvent'
import './styles.scss'

const HoursFormatted = ({ data }) => {
  const {
    startingDate,
    endingDate,
    startingTime,
    endingTime
  } = data

  if (data.multipleDays) {
    const isEnding = !!endingDate

    return (
      <div className='hours-formatted multiple-days'>
        {isEnding && (
          <div className='date'>
            {formatDateWithWords(startingDate)} - {formatDateWithWords(endingDate)}
          </div>
        )}

        {data.days.map((day, index) => (
          (day && day.day) &&
          <div key={index} className='day'>
            <div>{day.day.substr(0, 3)}</div>
            <span>{day.startingTime} - {day.endingTime}</span>
          </div>
        ))}
      </div>
    )
  }

  const isSameDay = startingDate.toDateString() === endingDate.toDateString();

  if (data.repeat) {
    const {
      days,
      every,
      forever,
      type,
      until,
      occurences,
      monthly,
      recurrenceEndDate
    } = data.recurring

{'fraction_non_alphanumeric': 0.13604603370324703, 'fraction_numerical': 0.0016440608302507192, 'mean_word_length': 2.3025780189959293, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, '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': '3396419', 'n_tokens_mistral': 774, 'n_tokens_neox': 747, 'n_words': 142}