connection-scan-algorithm
Version:
Connection Scan Algorithm
18 lines (17 loc) • 506 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Service {
constructor(startDate, endDate, days, dates) {
this.startDate = startDate;
this.endDate = endDate;
this.days = days;
this.dates = dates;
}
runsOn(date, dow) {
return this.dates[date] || (!this.dates.hasOwnProperty(date) &&
this.startDate <= date &&
this.endDate >= date &&
this.days[dow]);
}
}
exports.Service = Service;