Skip to content

Add scope to customPredictor#813

Open
lsapan wants to merge 1 commit into
charliekassel:masterfrom
lsapan:master
Open

Add scope to customPredictor#813
lsapan wants to merge 1 commit into
charliekassel:masterfrom
lsapan:master

Conversation

@lsapan

@lsapan lsapan commented Apr 3, 2020

Copy link
Copy Markdown

Hello, thanks for making this awesome library!

I realized as I was using it that when you disable dates using a customPredictor, that certain months and even years may become disabled. This is because the plugin checks the first date to see if it's disabled, rather than checking if any day in the given month/year is enabled. Makes total sense from a performance perspective in case the computation is heavy!

What I've done is simply added a second parameter to customPredictor which lets us know what scope we're dealing with. So, let's say I wanted to only allow certain days of the week, I can ensure that the scope is day before I say to disable the other dates. If the scope is anything else I can just always allow it.

@coveralls

coveralls commented Apr 3, 2020

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 6a910cf on lsapan:master into de0fc75 on charliekassel:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants