Add map last updated date to page

This commit is contained in:
2017-12-01 10:58:07 -05:00
parent 2e4faa70c6
commit b3e6a15142
2 changed files with 14 additions and 2 deletions

10
js/getMapUpdate.js Normal file
View File

@@ -0,0 +1,10 @@
var mapUpdateTime = document.getElementById('map-last-updated');
function getHeaderTime () {
mapUpdateTime.textContent = moment(this.getResponseHeader("Last-Modified")).calendar();
}
var oReq = new XMLHttpRequest();
oReq.open("HEAD", "/map/index.html");
oReq.onload = getHeaderTime;
oReq.send();