title: Adding background to days with event with FullCalendar
body: <p>I've defined a function to check whether a date has an event that returns true or false. For some reason, it's turning the cell of the next day to the color instead of the day that has an event. Oddly enough, my partner is using linux and it displays correctly for him, but every computer or vm i try it on with any operating system displays incorrectly. Here is the relevant code and a jsfiddle that displays the problem: </p>
  
  <pre><code>    $(document).ready(function() {
  var events = [];
  $.ajax({
                  url : 'https://showmeyouraxels.me/browse.php',
                  type : 'post',
                  dataType: 'json',
                  success: function(e){
                      console.log(e[0].title);
                      for(var i = 0; i &lt; e.length; i++){
                              events.push({
                                      title : e[i].title,
                                      start : moment(e[i].start).toDate('2017/07/18 12h:00'),
                                      end : moment(e[i].end).toDate('2017/07/18 12h:30'),
                                      icon: "https://www.qrstuff.com/images/sample.png",
                              });
                          }
                      console.log(events);
                      createCalendar();
                  }
          });
  function createCalendar(){
  
    var calendar = $('#calendar').fullCalendar({
          customButtons: {
              myCustomButton: {
                  text: 'Add Event',
                  click: function() {
                    alert('add event');
                  }
              }
          },
           header: {
              left: 'prev',
              center: 'title',
              right: 'next'
          },
          editable : false,
          eventLimit: true,
                  eventLimitText: '',
                  dayRender: function (date, cell) {
                      if ( !dateHasEvent(date) ){
                              cell.css("background-color", "initial");
                              console.log('no event ' + date.toDate());
                      }
                      else if ( dateHasEvent(date) ){
                              cell.css("background-color", "#6b7c8c");
                              console.log('event ' + date.toDate());
                      }
                  },
  
          eventClick: function(calEvent, jsEvent, view, element) {
                      var inner = new Date(calEvent.start) + ' to ' + new Date(calEvent.end);
                      swal({
                              title: calEvent.title,
                              html: true,
                              text: inner,
                              allowOutsideClick: true
                      });
          },
                  dayClick: function(dayEvent, jsEvent, view, element){
                      console.log(dayEvent);
                  },
          eventRender: function(event, element) {
                      element.find('.fc-content').html('&lt;img src="http://simpleicon.com/wp-content/uploads/flag.svg" height="10px"/&gt;&lt;br&gt;' +event.title);
  
          },
      });
          calendar.fullCalendar( 'addEventSource', events);
      }
  
      function dateHasEvent(date) {
          var hasEvent = false;
          for(var i = 0; i &lt; events.length; i++){
           var thatDate = events[i].start.toString();
           thatDate = thatDate.split(' ');
           thatDate = thatDate[1] +' '+thatDate[2] +' '+thatDate[3];
  
           var thisDate = date.toDate().toString();
           thisDate = thisDate.split(' ');
           thisDate = thisDate[1] +' '+thisDate[2] +' '+thisDate[3];
  
           if(thisDate == thatDate){
               hasEvent = true;
              }
          }
          return hasEvent;
      }
  
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/CYnJY/883/" rel="nofollow noreferrer" title="I believe there is an allow origin error with my site, so if you don&#39;t have the allow origin chrome extension the calendar may not load with the jsfiddle">JSFiddle</a></p>
  
  <p>I've been scratching my head for the past day and i'd have to imagine it's something stupid that i'm missing. 
  Thank you for any help you can provide! </p>