Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nicholas J Anderson
whats-open
Commits
25f4f0be
Commit
25f4f0be
authored
Sep 22, 2013
by
Renfred Harper
Browse files
Clean conditional strcuture
parent
75ca4eb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
website/static/js/grid.js
View file @
25f4f0be
...
...
@@ -116,8 +116,10 @@ $.ajax({
var
last_updated
=
new
Date
();
setInterval
(
function
(){
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
(
last_updated
.
getHours
()
!=
now
.
getHours
()
||
(
last_updated
.
getMinutes
()
<
30
&&
now
.
getMinutes
()
>=
30
)
||
now
-
last_updated
>
1800000
){
// If the hour has changed, it the half hour has changed
// 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
);
construct_grid
(
restaurants
);
last_updated
=
new
Date
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment