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
SRCT
whats-open
Commits
0122836f
Commit
0122836f
authored
Nov 26, 2013
by
Renfred Harper
Browse files
Fix bug that disabled special schedules
parent
9504e9bc
Changes
1
Show whitespace changes
Inline
Side-by-side
website/static/js/grid.js
View file @
0122836f
...
...
@@ -58,7 +58,7 @@ function construct_grid(filtered_restaurants) {
function
update_grid
(
restaurants
)
{
$
.
each
(
restaurants
,
function
(
idx
,
restaurant
)
{
var
now
=
new
Date
();
var
date
=
new
Date
()
.
setHours
(
0
,
0
,
0
,
0
);
var
date
=
new
Date
()
// JavaScript sets 0 to Sunday instead of Monday
var
day
=
now
.
getDay
()
-
1
;
if
(
day
===
-
1
)
{
...
...
@@ -69,7 +69,7 @@ function update_grid(restaurants) {
$
.
each
(
restaurant
.
special_schedules
,
function
(
idx
,
special
)
{
// Special schedules take effect after 5am on their start day
// to prevent collisions with the previous night's schedule
if
(
date
>=
Date
.
parse
(
special
.
start
).
setHours
(
5
,
0
,
0
,
0
)
if
(
date
>=
Date
.
parse
(
special
.
start
+
'
05:00:00
'
)
&&
date
<=
Date
.
parse
(
special
.
end
))
{
schedule
=
special
;
}
...
...
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