-
-
Notifications
You must be signed in to change notification settings - Fork 384
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
start_of('week') and day_of_week inconsistent #683
Comments
I'm also encountering this issue. Setting
|
I had a look at def day_of_week(self):
"""
Returns the day of the week (0-6).
:rtype: int
"""
return self.isoweekday() % 7 and saw that it calls Python's built-in def isoweekday(self):
"Return day of the week, where Monday == 1 ... Sunday == 7."
# 1-Jan-0001 is a Monday
return self.toordinal() % 7 or 7 The issue is caused by the I see two solutions
Which is preferable? |
If today is Sunday, then start_of('week') will actually go back to the previous Monday.
Yet day_of_week will say 0.
"ISO8601 week starts on Monday"
If this is enforced then it should be consistent.
Thanks
The text was updated successfully, but these errors were encountered: