// function reloadFromServer() {
// 	location.reload(true); //“true” parameter to reload from server, not cache
// }

//on page load
if (typeof(Storage) !== "undefined") { // check browser support for localStorage

	// Code for localStorage/sessionStorage.
	if (localStorage.lffLastLoadedDate) {

		var lffLastLoadedDate = new Date(localStorage.lffLastLoadedDate);
		var currentDate = new Date();

		// if lffLastLoadedDate is different from currentDate
		if (lffLastLoadedDate.getFullYear() != currentDate.getFullYear() ||
			lffLastLoadedDate.getMonth() != currentDate.getMonth() ||
			lffLastLoadedDate.getDate() != currentDate.getDate()) {

			// replace localStorage.lffLastLoadedDate with current date
			localStorage.lffLastLoadedDate = new Date();

			// reload current document (does the same as the reload button in the browser), delayed to give service worker time
			//setTimeout(reloadFromServer, 200);
			location.reload(true); //“true” parameter to reload from server, not cache
			//window.location.href = window.location.href.split( '#' )[0];
		}
	}
	else {
		// initialize localStorage.lffLastLoadedDate with current date
		localStorage.lffLastLoadedDate = new Date();
	}
}
