function convertDateStringToDateObj (str) {
  let dates     = getMatchDates(str),
      times     = getMatchTimes(str).map((t) => convertTimeStrToHourStr(t, true)),
      parts     = str.split(' '),
      zone      = parts[parts.length - 1],
      startDate = dates[0] ? dates[0].trim() : 'January 1, 1970',
      endDate   = dates[1] ? dates[1].trim() : null;

  return {
    start : {
      date     : startDate,
      startTime: times[0],
      endTime  : times[1],
      zone     : zone
    }, end: {
      date     : endDate,
      startTime: times[0],
      endTime  : times[1],
      zone     : zone
    }
  };
}
/*
 The calendar ws returns the date, time and time zone in a formatted string, ex:
 October 17, 2016 - October 18, 2016, 9:00 AM - 5:00 PM America/New_York
 Need to bread it up into pieces
 */
The calendar ws returns the date, time and time zone in a formatted string, ex:
October 17, 2016 - October 18, 2016, 9:00 AM - 5:00 PM America/New_York
Need to bread it up into pieces
The calendar ws returns the date time and time zone in a formatted string ex : October 17 2016 - October 18 2016 9 : 00 AM - 5 : 00 PM America / New_York Need to bread it up into pieces
function convertDateStringToDateObj (str) {
  let dates     = getMatchDates(str),
      times     = getMatchTimes(str).map((t) => convertTimeStrToHourStr(t, true)),
      parts     = str.split(' '),
      zone      = parts[parts.length - 1],
      startDate = dates[0] ? dates[0].trim() : 'January 1, 1970',
      endDate   = dates[1] ? dates[1].trim() : null;
  return {
    start : {
      date     : startDate,
      startTime: times[0],
      endTime  : times[1],
      zone     : zone
    }, end: {
      date     : endDate,
      startTime: times[0],
      endTime  : times[1],
      zone     : zone
    }
  };
}
function convertDateStringToDateObj ( str ) { let dates = getMatchDates ( str ) , times = getMatchTimes ( str ) . map ( ( t ) => convertTimeStrToHourStr ( t , true ) ) , parts = str . split ( ' ' ) , zone = parts [ parts . length - 1 ] , startDate = dates [ 0 ] ? dates [ 0 ] . trim ( ) : 'January 1, 1970' , endDate = dates [ 1 ] ? dates [ 1 ] . trim ( ) : null ; return { start : { date : startDate , startTime : times [ 0 ] , endTime : times [ 1 ] , zone : zone } , end : { date : endDate , startTime : times [ 0 ] , endTime : times [ 1 ] , zone : zone } } ; }
The calendar ws returns the date, time and time zone in a formatted string, ex:
October 17, 2016 - October 18, 2016, 9:00 AM - 5:00 PM America/New_York
Need to bread it up into pieces
The calendar ws returns the date time and time zone in a formatted string ex : October 17 2016 - October 18 2016 9 : 00 AM - 5 : 00 PM America / New_York Need to bread it up into pieces