title: Multiple date entries
body: <p>Here is some images for the intents and entites</p>
  
  <p><a href="https://i.stack.imgur.com/EJvra.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EJvra.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/yrPRw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yrPRw.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/UkapM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UkapM.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/P5XCE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/P5XCE.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ziZoa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ziZoa.png" alt="enter image description here"></a></p>
  
  <p>I am collecting dates from users to se for creating google calendar events but as soon as I add the code for the second date even if it is not in use it fails to work for any of both dates
  it gives this error in firebase:</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'split' of undefined
        at exports.dialogflowFirebaseFulfillment.functions.https.onRequest (/srv/index.js:38:68)
        at cloudFunction (/srv/node_modules/firebase-functions/lib/providers/https.js:37:41)
        at /worker/worker.js:783:7
        at /worker/worker.js:766:11
        at _combinedTickCallback (internal/process/next_tick.js:132:7)
        at process._tickDomainCallback (internal/process/next_tick.js:219:9)</p>
  </blockquote>
  
  <p>This is my code</p>
  
  <pre><code>   function makeAppointment2 (agent) {
     const dateTimeStart = new Date(Date.parse(agent.parameters.date.split('T')[0] + 'T' + agent.parameters.time.split('T')[1].split('+')[0] + timeZoneOffset));
     const dateTimeEnd = new Date(new Date(dateTimeStart).setHours(dateTimeStart.getHours() + 1));
     const dateTimeStart2 = new Date(Date.parse(agent.parameters.date2.split('T')[0] + 'T' + agent.parameters.time2.split('T')[1].split('+')[0] + timeZoneOffset));
     const dateTimeEnd2 = new Date(new Date(dateTimeStart2).setHours(dateTimeStart2.getHours() + 1));
     const appointmentTimeString = dateTimeStart.toLocaleString(
       'en-US',
       { month: 'long', day: 'numeric', hour: 'numeric', timeZone: timeZone }
     );
     const appointmentTimeString2 = dateTimeStart2.toLocaleString(
       'en-US',
       { month: 'long', day: 'numeric', hour: 'numeric', timeZone: timeZone }
     );
     return createCalendarEvent2(dateTimeStart, dateTimeEnd, name, location, dateTimeStart2, dateTimeEnd2).then(() =&gt; {
       agent.add(`Great Mr/Mrs ${name}, your appointment has been scheduled on ${appointmentTimeString} &amp; ${appointmentTimeString2}!.`);
       agent.add(`${response2}`);
     }).catch(() =&gt; {
       agent.add(`I'm sorry Mr/Mrs ${name}, there are no slots available for ${appointmentTimeString} Please choose another date.`);
     });
   function createCalendarEvent2 (dateTimeStart, dateTimeEnd, appointment_name, location, dateTimeStart2, dateTimeEnd2) {
    return new Promise((resolve, reject) =&gt; {
      calendar.events.list({
        auth: serviceAccountAuth,
        calendarId: calendarId,
        timeMin: dateTimeStart.toISOString(),
        timeMax: dateTimeEnd.toISOString()
      }, (err, calendarResponse) =&gt; {
  
        if (err || calendarResponse.data.items.length &gt; 0) {
          reject(err || new Error('Requested time conflicts with another appointment'));
        } else {
  
          calendar.events.insert({ auth: serviceAccountAuth,
            calendarId: calendarId,
            resource: {
     'summary': appointment_name + "1st" ,
     'description': location,
     'start': {
       'dateTime': dateTimeStart,
     },
     'end': {
       'dateTime': dateTimeEnd,
     },
   } ,
          }, (err, event) =&gt; {
            err ? reject(err) : resolve(event);
          }
          );
        }
      });
      calendar.events.list({
        auth: serviceAccountAuth,
        calendarId: calendarId,
        timeMin: dateTimeStart2.toISOString(),
        timeMax: dateTimeEnd2.toISOString()
      }, (err, calendarResponse) =&gt; {
  
        if (err || calendarResponse.data.items.length &gt; 0) {
          reject(err || new Error('Requested time conflicts with another appointment'));
        } else {
  
          calendar.events.insert({ auth: serviceAccountAuth,
            calendarId: calendarId,
            resource: {
     'summary': appointment_name + "2nd" ,
     'description': location,
     'start': {
       'dateTime': dateTimeStart2,
     },
     'end': {
       'dateTime': dateTimeEnd2,
     },
    } ,
          }, (err, event) =&gt; {
            err ? reject(err) : resolve(event);
          }
          );
        }
      });
  
    });
  </code></pre>