Commit 25f4f0be authored by Renfred Harper's avatar Renfred Harper
Browse files

Clean conditional strcuture

parent 75ca4eb0
...@@ -116,8 +116,10 @@ $.ajax({ ...@@ -116,8 +116,10 @@ $.ajax({
var last_updated = new Date(); var last_updated = new Date();
setInterval(function(){ setInterval(function(){
now = new Date(); now = new Date();
// If the hour has changed, it the half hour has changed or it has been over a half hour since the last update. // If the hour has changed, it the half hour has changed
if (last_updated.getHours() != now.getHours() || (last_updated.getMinutes() < 30 && now.getMinutes() >= 30) || now - last_updated > 1800000){ // or it has been over a half hour (180000 milliseconds) since the last update.
if (last_updated.getHours() != now.getHours() ||
(last_updated.getMinutes() < 30 && now.getMinutes() >= 30) || now - last_updated > 1800000){
update_grid(restaurants); update_grid(restaurants);
construct_grid(restaurants); construct_grid(restaurants);
last_updated = new Date(); last_updated = new Date();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment