partial #697
This commit is contained in:
parent
35523ca57d
commit
00a3a50157
@ -424,7 +424,12 @@ class Crunchbutton_Restaurant extends Cana_Table
|
||||
$today = $DeLorean->now();
|
||||
$day = strtolower($today->format('D'));
|
||||
|
||||
$hasHours = false;
|
||||
|
||||
foreach ($hours as $hour) {
|
||||
|
||||
$hasHours = true;
|
||||
|
||||
if ($hour->day != $day) {
|
||||
continue;
|
||||
}
|
||||
@ -443,6 +448,10 @@ class Crunchbutton_Restaurant extends Cana_Table
|
||||
}
|
||||
}
|
||||
|
||||
if( !$hasHours ){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -119,14 +119,18 @@ var Restaurant = function(id) {
|
||||
*/
|
||||
self.open = function() {
|
||||
|
||||
// console.log(this.timezone);
|
||||
// If it doesn't have hours it means it is always opened
|
||||
if( !this._hours ){
|
||||
return true;
|
||||
}
|
||||
|
||||
var isOpen = false;
|
||||
var today = Date.today().toString('ddd').toLowerCase();
|
||||
if (this._hours == undefined || this._hours[today] == undefined) {
|
||||
return false;
|
||||
}
|
||||
todayHours = this._hours[today];
|
||||
console.log('today', today)
|
||||
|
||||
for (i in todayHours) {
|
||||
|
||||
var openTime = Date.parse(todayHours[i][0]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user