const newDateEndMode = (newDate, startDate, smartMode, endDate) => {
  // Create a new moment object which combines the new date and the original end date as newDate
  // doesnt contain time info which is important to determining equality
  let newDateWithTime = createNewDateWithTime(newDate, endDate.hour(), endDate.minute(), endDate.second());
  if (newDateWithTime.isSameOrAfter(startDate, 'seconds')) {