adding update time very hastily to the top right

This commit is contained in:
Lucas
2021-10-09 20:12:44 -04:00
parent 1a7c2c9a9c
commit 10c2b9ffca
4 changed files with 38 additions and 21 deletions

View File

@@ -17,9 +17,9 @@
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<script src="/static/js/DataRequests.js"></script>
<script src="/static/js/MtaData.js"></script>
<title>Hello, world!</title>
<title>Pi MTA Display!</title>
</head>
<body class="dark">
<nav class="navbar navbar-dark bg-dark py-2">
@@ -31,6 +31,9 @@
Pi MTA Display!
</h1>
</a>
<h3>
Last Updated:&nbsp;&nbsp;<span id="last_updated"></span>
</h3>
</div>
</nav>
<div id="station_1">
@@ -205,8 +208,5 @@
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
</body>
</html>

View File

@@ -28,6 +28,12 @@ $(document).ready(function () {
function updateStation(station, data) {
updateDirections(station, data, "North");
updateDirections(station, data, "South");
updateTime(data["LastUpdated"])
}
function updateTime(lastUpdated){
console.log(lastUpdated)
$("#last_updated").text(lastUpdated)
}
function updateDirections(station, data, direction) {