From 78a8b60efa787678b6ec021d709fbeae1492961d Mon Sep 17 00:00:00 2001 From: Abhas Bhattacharya Date: Fri, 23 Mar 2018 00:46:45 +0530 Subject: [PATCH] Utils - Show next opening takes care of all holidays Even though show closing takes care of only event holidays --- src/Utils/utils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Utils/utils.ts b/src/Utils/utils.ts index b6c930b..d47b6cb 100644 --- a/src/Utils/utils.ts +++ b/src/Utils/utils.ts @@ -93,13 +93,14 @@ export class Utils { let currentDay = xDay.clone().add(1, "day"); 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; } - if ((openOrClose === OpenOrClose.Close) && (holidayOnCurrentDay !== undefined)) { + if ((openOrClose === OpenOrClose.Close) && (eventHolidayOnCurrentDay)) { return currentDay; }