<commit_before>import React from 'react'
import { DropTarget } from 'react-dnd'
import cn from 'classnames';

import dates from '../../utils/dates';
import BigCalendar from '../../index'

export function getEventTimes({ start, end }, dropDate, type) {
  // Calculate duration between original start and end dates
  const duration = dates.diff(start, end)

  // If the event is dropped in a "Day" cell, preserve an event's start time by extracting the hours and minutes off
  // the original start date and add it to newDate.value
  const nextStart = type === 'dateWrapper'
    ? dates.merge(dropDate, start) : dropDate

  const nextEnd = dates.add(nextStart, duration, 'milliseconds')

  return {
    start: nextStart,
    end: nextEnd
  }
}

const propTypes = {
  connectDropTarget: React.PropTypes.func.isRequired,
  type: React.PropTypes.string,
  isOver: React.PropTypes.bool,
}

class DraggableBackgroundWrapper extends React.Component {
  // constructor(...args) {
  //   super(...args);
  //   this.state = { isOver: false };
  // }
  //
  // componentWillMount() {
  //   let monitor = this.context.dragDropManager.getMonitor()<commit_msg>Fix dnd date merge when moving an event to a date cell<commit_after>import React from 'react'
import { DropTarget } from 'react-dnd'
import cn from 'classnames';

import dates from '../../utils/dates';
import BigCalendar from '../../index'

export function getEventTimes({ start, end }, dropDate, type) {
  // Calculate duration between original start and end dates
  const duration = dates.diff(start, end)

  // If the event is dropped in a "Day" cell, preserve an event's start time by extracting the hours and minutes off
  // the original start date and add it to newDate.value
  const nextStart = type === 'dateCellWrapper'
    ? dates.merge(dropDate, start) : dropDate

  const nextEnd = dates.add(nextStart, duration, 'milliseconds')

  return {
    start: nextStart,
    end: nextEnd
  }
}

const propTypes = {
  connectDropTarget: React.PropTypes.func.isRequired,
  type: React.PropTypes.string,
  isOver: React.PropTypes.bool,
}

class DraggableBackgroundWrapper extends React.Component {
  // constructor(...args) {
  //   super(...args);
  //   this.state = { isOver: false };
  // }
  //
  // componentWillMount() {
  //   let monitor = this.context.dragDropManager.getMonitor()
{'fraction_non_alphanumeric': 0.12056434373663959, 'fraction_numerical': 0.0, 'mean_word_length': 3.4486692015209126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2391258', 'n_tokens_mistral': 692, 'n_tokens_neox': 683, 'n_words': 224}