From b49d26bff4fc9b3a2fd9bc266aa018a688b3e260 Mon Sep 17 00:00:00 2001 From: commenthol Date: Sun, 2 May 2021 07:52:19 +0200 Subject: [PATCH] refactor: calevent.filterActive --- src/CalEvent.js | 2 +- src/PostRule.js | 2 +- test/CalEvent.mocha.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CalEvent.js b/src/CalEvent.js index ae10205..4abf05e 100644 --- a/src/CalEvent.js +++ b/src/CalEvent.js @@ -44,7 +44,7 @@ export default class CalEvent { * @param {Object[]} active - definition of active ranges `{from: {Date}, [to]: {Date}}` * @return {this} for chaining */ - filter (year, active = this.active) { + filterActive (year, active = this.active) { this.dates = this.dates.filter((date) => { if (!date._filter && isActive(date, year, active)) { return date diff --git a/src/PostRule.js b/src/PostRule.js index 86849fb..92eb335 100644 --- a/src/PostRule.js +++ b/src/PostRule.js @@ -25,7 +25,7 @@ export default class PostRule { const active = this.ruleSet && this.ruleSet.active this.disable(year) const ev = this.events[0] - ev.filter(year, active) + ev.filterActive(year, active) return ev } diff --git a/test/CalEvent.mocha.js b/test/CalEvent.mocha.js index 99a9e62..570838c 100644 --- a/test/CalEvent.mocha.js +++ b/test/CalEvent.mocha.js @@ -183,7 +183,7 @@ describe('#CalEvent', function () { const exp = test.exp it('in year ' + year, function () { const date = new CalEvent(event) - date.inYear(year).filter(year, active) + date.inYear(year).filterActive(year, active) const res = date.get() assert.strictEqual(res.length, exp.length) if (exp.length) {