Commit 75ca4eb0 authored by Renfred Harper's avatar Renfred Harper
Browse files

Add current time attribute to restaurant objects

parent f18b590c
......@@ -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;
}
}
......
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