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
75ca4eb0
Commit
75ca4eb0
authored
Sep 22, 2013
by
Renfred Harper
Browse files
Add current time attribute to restaurant objects
parent
f18b590c
Changes
1
Show whitespace changes
Inline
Side-by-side
website/static/js/grid.js
View file @
75ca4eb0
...
...
@@ -64,10 +64,12 @@ function update_grid(restaurants) {
if
(
day
===
end_day
)
{
if
(
now
<=
Date
.
parse
(
time
.
end_time
))
{
restaurant
.
open
=
true
;
restaurant
.
current
=
time
;
return
false
;
}
}
else
{
restaurant
.
open
=
true
;
restaurant
.
current
=
time
;
return
false
;
}
...
...
@@ -77,21 +79,25 @@ function update_grid(restaurants) {
if
(
day
===
start_day
)
{
if
(
now
>=
Date
.
parse
(
time
.
start_time
))
{
restaurant
.
open
=
true
;
restaurant
.
current
=
time
;
return
false
;
}
}
else
{
restaurant
.
open
=
true
;
restaurant
.
current
=
time
;
return
false
;
}
}
}
else
if
(
start_day
<
end_day
)
{
if
(
day
>
start_day
&&
day
<
end_day
)
{
restaurant
.
open
=
true
;
restaurant
.
current
=
time
;
return
false
;
}
}
else
if
(
start_day
>
end_day
)
{
if
(
day
<
start_day
||
day
>
end_day
)
{
restaurant
.
open
=
true
;
restaurant
.
current
=
time
;
return
false
;
}
}
...
...
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