Always display time of the day
This commit is contained in:
parent
9efaf3d1ff
commit
bb6b933762
11
app.js
11
app.js
@ -106,7 +106,8 @@ function getSchedule(type, code, station, way) {
|
||||
$("<dd/>", { text: val["message"] }).appendTo("#schedule dl");
|
||||
});
|
||||
$("#schedule").show();
|
||||
$("#update").text(data["_metadata"]["date"]);
|
||||
|
||||
updateTime(new Date(data["_metadata"]["date"]));
|
||||
|
||||
nextSchedule = setTimeout(function() {
|
||||
getSchedule(type, code, station, way);
|
||||
@ -114,6 +115,14 @@ function getSchedule(type, code, station, way) {
|
||||
});
|
||||
}
|
||||
|
||||
function updateTime(time) {
|
||||
var hours = time.getHours();
|
||||
var minutes = time.getMinutes();
|
||||
|
||||
$("#update").text(hours + ":" + (minutes < 10 ? '0' + minutes : minutes));
|
||||
}
|
||||
updateTime(new Date());
|
||||
|
||||
function main(uri, fetchTrafic) {
|
||||
$("#lines").hide();
|
||||
$("#line").attr("disabled", true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user