mirror of
https://github.com/bendtherules/is-nifty-open.git
synced 2026-08-18 13:52:20 +00:00
Utils - Show next opening takes care of all holidays
Even though show closing takes care of only event holidays
This commit is contained in:
+4
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user