magritton
12/28/2016 - 9:47 PM

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

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;
	});