From b2b90d4339abcc1b1cbacf14a5306a39ad5a6e24 Mon Sep 17 00:00:00 2001 From: Zakhar Zibarov Date: Fri, 5 Sep 2014 23:08:56 +0400 Subject: [PATCH] fix span_range for week frame --- arrow/arrow.py | 3 ++- tests/arrow_tests.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arrow/arrow.py b/arrow/arrow.py index 97ce3624b..af43037f8 100644 --- a/arrow/arrow.py +++ b/arrow/arrow.py @@ -264,7 +264,8 @@ def span_range(cls, frame, start, end, tz=None, limit=None): (, ) ''' - + 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] diff --git a/tests/arrow_tests.py b/tests/arrow_tests.py index 9a51098c2..b80937dc4 100644 --- a/tests/arrow_tests.py +++ b/tests/arrow_tests.py @@ -643,6 +643,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)), ])