Skip to content

BDay() subtraction bug when the starting date is not on offset #2680

Closed
rhaskett opened this Issue Jan 10, 2013 · 0 comments

2 participants

@rhaskett

Note the output skips the weekday 12/23/2011.

dt = datetime(2012, 1, 1)

for i in range(1,10):
    print i, (dt - i * BDay()).strftime('%m/%d/%Y')

1 12/30/2011
2 12/29/2011
3 12/28/2011
4 12/27/2011
5 12/26/2011
6 12/22/2011
7 12/21/2011
8 12/20/2011
9 12/19/2011

however when the start date is onoffset it works fine

dt = datetime(2011, 12, 30)

for i in range(1, 10):
    print i, (dt - i * BDay()).strftime('%m/%d/%Y')

1 12/29/2011
2 12/28/2011
3 12/27/2011
4 12/26/2011
5 12/23/2011
6 12/22/2011
7 12/21/2011
8 12/20/2011
9 12/19/2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.