Skip to content

Commit

Permalink
Merge pull request arrow-py#164 from zakhar/fix_week_span_range
Browse files Browse the repository at this point in the history
fix span_range stability Thanks @zakhar
  • Loading branch information
andrewelkins committed Jul 9, 2015
2 parents d8809f8 + b2b90d4 commit 5248ed3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arrow/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ def span_range(cls, frame, start, end, tz=None, limit=None):
(<Arrow [2013-05-05T16:00:00+00:00]>, <Arrow [2013-05-05T16:59:59.999999+00:00]>)
'''

tzinfo = cls._get_tzinfo(start.tzinfo if tz is None else tz)
start = cls.fromdate(start, tzinfo).span(frame)[0]
_range = cls.range(frame, start, end, tz, limit)
return [r.span(frame) for r in _range]

Expand Down
1 change: 1 addition & 0 deletions tests/arrow_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ def test_week(self):
(arrow.Arrow(2013, 2, 4), arrow.Arrow(2013, 2, 10, 23, 59, 59, 999999)),
(arrow.Arrow(2013, 2, 11), arrow.Arrow(2013, 2, 17, 23, 59, 59, 999999)),
(arrow.Arrow(2013, 2, 18), arrow.Arrow(2013, 2, 24, 23, 59, 59, 999999)),
(arrow.Arrow(2013, 2, 25), arrow.Arrow(2013, 3, 3, 23, 59, 59, 999999)),
])


Expand Down

0 comments on commit 5248ed3

Please sign in to comment.