This JavaScript function takes care of the the fact that SharePoint turns a date into a UTC date which puts the date a day behind if you do not compensate.
var handleDate = (function(date){
var newDate = new Date(date.replace('-',' '));
var timeZoneOffset = newDate.getTimezoneOffset()/60;
newDate.setHours(newDate.getHours()+timeZoneOffset);
return newDate;
});