Browse Source

UI-3140: Lunch hours time of day object will only be valid on days the business is open (#78)

4.3
Remco van Vugt 7 years ago
committed by Joris Tirado
parent
commit
930fb06a7b
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      submodules/strategy/strategy.js

+ 12
- 0
submodules/strategy/strategy.js View File

@ -1639,6 +1639,18 @@ define(function(require) {
if (customHours.lunchbreak.enabled) {
var lunchbreakRule = strategyData.temporalRules.lunchbreak;
// make sure the lunch rule is only valid on days the business is open
delete lunchbreakRule.wdays;
var lunchwdays = [];
_.each(customHours.opendays, function(val) {
lunchwdays.push(val.substring(4).toLowerCase());
});
lunchbreakRule = $.extend(true, {
wdays: lunchwdays
}, lunchbreakRule);
lunchbreakRule.time_window_start = monster.util.timeToSeconds(customHours.lunchbreak.from);
lunchbreakRule.time_window_stop = monster.util.timeToSeconds(customHours.lunchbreak.to);
tmpRulesRequests.lunchbreak = function(callback) {


Loading…
Cancel
Save