Skip to content

Commit

Permalink
refactor: calevent.filterActive
Browse files Browse the repository at this point in the history
  • Loading branch information
commenthol committed May 2, 2021
1 parent 7db3d6b commit b49d26b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CalEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/PostRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion test/CalEvent.mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b49d26b

Please sign in to comment.