Add map last updated date to page
This commit is contained in:
parent
2e4faa70c6
commit
b3e6a15142
@ -75,7 +75,8 @@
|
||||
View the server map
|
||||
</a>
|
||||
<p class="small-text">
|
||||
Map is updated every day around 3 am EST.
|
||||
Map is updated every day around 3 am EST. Last updated:
|
||||
<span id="map-last-updated" class="small-text"></span>
|
||||
</p>
|
||||
|
||||
<h2>Server Log</h2>
|
||||
@ -94,5 +95,6 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.19.2/moment.min.js"></script>
|
||||
<script src="js/getStatus.js"></script>
|
||||
<script src="js/getLog.js"></script>
|
||||
<script src="js/getMapUpdate.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
10
js/getMapUpdate.js
Normal file
10
js/getMapUpdate.js
Normal 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();
|
Loading…
Reference in New Issue
Block a user