title: Javascript new Date() Concat Date and Time Doesn't Work on Mobile Browsers
body: <p>I'm using an <a href="https://github.com/carlsednaoui/add-to-calendar-buttons" rel="nofollow noreferrer">open-source script</a> that adds an event to an external calendar. I am also using moment to alter time format. </p>
  
  <pre><code>  this.addToCalendar = createCalendar({
      options: {
        class: 'addtocal-btn',
        id: 'event-' + this.item.id                                // You need to pass an ID. If you don't, one will be generated for you.
      },
      data: {
        title: this.item.title,     // Event title
        start: new Date(this.calendarDate(this.item.start_date) + ' ' + moment(this.item.start_time, ["h:mm A"]).format("HH:mm")),   // Event start date
        end: new Date(this.calendarDate(this.item.end_date) + ' ' + moment(this.item.end_time, ["h:mm A"]).format("HH:mm")),     // You can also choose to set an end time.
        address: this.item.location,
        description: this.item.description,
        timezone: 'America/Detroit'
      }
    });
  </code></pre>
  
  <p>Unfortunately, the date and time are separate in the database, and so I have to concatenate the two inside of the Date() function. </p>
  
  <p>A sample start_date would be '2018-10-15 00:00:00', while a sample start_time would be '10:00 p.m.' Hence why I have to run start_date through a function and start_time through moment to get the proper formatting.</p>
  
  <pre><code>// If 2018-10-15 00:00:00 is passed, returns 2018-10-15
  calendarDate: function (value) {
    var arr = value.split(' ');
    return arr[0]
  },
  </code></pre>
  
  <p>Anyway <strong>the problem is</strong> that, while this works just fine on desktop browsers, it does NOT work on mobile browsers. And as I am unable to do any testing directly on the mobile device, I can't diagnose the problem directly.</p>
  
  <p>I've been able to narrow the issue down to the concatenation of the date and time, but I don't know  why the desktop browsers accept it and the mobile browsers don't (FYI, I have tried this in Safari and Chrome on an iPhone6s Plus)</p>