Utils - Show next opening takes care of all holidays

Even though show closing takes care of only event holidays
This commit is contained in:
2018-03-23 00:46:45 +05:30
parent 508c034276
commit 78a8b60efa
+4 -3
View File
@@ -93,13 +93,14 @@ export class Utils {
let currentDay = xDay.clone().add(1, "day"); let currentDay = xDay.clone().add(1, "day");
while (this.checkSameYearInSameTZ(currentDay, xDay)) { while (this.checkSameYearInSameTZ(currentDay, xDay)) {
var holidayOnCurrentDay = this.getEventHolidayOnDate(currentDay, allHolidays); var eventHolidayOnCurrentDay: boolean = this.getEventHolidayOnDate(currentDay, allHolidays) !== undefined;
var openOnCurrentDay: boolean = this.getHolidayAnswerOnDate(currentDay, allHolidays).open;
if ((openOrClose === OpenOrClose.Open) && (holidayOnCurrentDay === undefined)) { if ((openOrClose === OpenOrClose.Open) && (openOnCurrentDay)) {
return currentDay; return currentDay;
} }
if ((openOrClose === OpenOrClose.Close) && (holidayOnCurrentDay !== undefined)) { if ((openOrClose === OpenOrClose.Close) && (eventHolidayOnCurrentDay)) {
return currentDay; return currentDay;
} }