Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to change the default weekend days (6 & 7)? #16

Closed
fabianbruckschen opened this issue Apr 13, 2018 · 2 comments
Closed

Comments

@fabianbruckschen
Copy link

First of all, this is a great python module, so thank you.
In my case I want to apply it (in particular the bc.utils.all function) to a muslim country. It all works fine, besides the fact that the weekend is actually on Friday and Saturday (so day [5,6] and not [6,7]). Is there an easy way to integrate it into the function?
Thanks in advance
fabibru

@cynddl
Copy link
Collaborator

cynddl commented Apr 13, 2018

Hello @fabianbruckschen, and thanks for your interest in bandicoot. There is indeed a per-user option to change the default weekend days:
https://github.com/yvesalexandre/bandicoot/blob/b26cfb05568ab762b93ad5efef8eebd099b7e9b5/bandicoot/core.py#L178


Once you have a user object (eg. my_user = bc.tests.sample_user(), you can set:

my_user.weekend = [5, 6]  # instead of [6, 7]

to change the default weekend days.

@fabianbruckschen
Copy link
Author

Hi @cynddl,
thank you very much for this fast answer and simple solution by altering the user object.
Keep up the good work.

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

No branches or pull requests

2 participants