Skip to content

Commit

Permalink
[5.1] MSPB-292: Fix issue where user can't update from advanced to si…
Browse files Browse the repository at this point in the history
…ngle date (#460)
  • Loading branch information
pcandia authored Sep 1, 2022
1 parent 587da11 commit 614efd6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion submodules/strategy/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4316,7 +4316,7 @@ define(function(require) {
}, !formData.allDay && isSingleDate && {
time_window_start: $startTimepicker.timepicker('getSecondsFromMidnight'),
time_window_stop: $endTimepicker.timepicker('getSecondsFromMidnight')
}, ((isHolidayStartDate && formData.allDay && isSingleDate) || (isHolidayStartDate && isNotSingleDate)) && {
}, holidayId && ((isHolidayStartDate && formData.allDay && isSingleDate) || (isHolidayStartDate && isNotSingleDate)) && {
time_window_start: null,
time_window_stop: null
}),
Expand Down
9 changes: 8 additions & 1 deletion submodules/strategyHolidays/strategyHolidays.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ define(function(require) {
if (_.isUndefined(holidayRule.holidayData.excludeYear)) {
holidayRule.holidayData.excludeYear = [];
}

holidayRule.holidayData.excludeYear.push(yearSelected);
holidayRule.modified = true;
self.appFlags.strategyHolidays.allHolidays[key] = holidayRule;
Expand All @@ -477,6 +478,9 @@ define(function(require) {
_.omit(data, ['holidayData.id'])
);
} else {
if (holidayRule.holidayType === 'advanced' && data.holidayType !== 'advanced') {
data.holidayData.ordinal = null;
}
self.appFlags.strategyHolidays.allHolidays[key] = data;
}
}
Expand Down Expand Up @@ -1044,9 +1048,12 @@ define(function(require) {
holidayRule.days = _.range(fromDay, toDay + 1);
}
} else {
holidayRule.ordinal = holidayData.ordinal;
holidayRule.wdays = [holidayData.wday];
}

if (holidayData.hasOwnProperty('ordinal')) {
holidayRule.ordinal = holidayData.ordinal;
}
}

if (holidayData.excludeYear) {
Expand Down

0 comments on commit 614efd6

Please sign in to comment.