I'm pulling events from google calendar.
I'm able to see an event date:
var date = when.split("T")[0];
console.log(date);
This outputs 2016-01-07
. Then I put it into an array inside an object:
allEvents.push({
eventDate:date,
eventTime:time,
eventTBD:TBD
});
Then, when I go to grab the date again:
$.each(allEvents, function(i, v){
var eventDate = new Date(v.eventDate);
if(eventDate > startDate && eventDate < endDate){
console.log(v.eventDate);
console.log("Show This Date: " + eventDate);
}
});
For January, I get this output:
2016-01-07
Show This Date: Wed Jan 06 2016 19:00:00 GMT-0500 (EST)
for March, I get this output:
2016-03-19
Show This Date: Fri Mar 18 2016 20:00:00 GMT-0400 (EDT)
It's showing the day before the date I just showed... It seems to be 5 hours off? Do I need to account for this? How do I do so?