Skip to content

Commit

Permalink
Fix fatal AttributeError using Arrow 0.14.5
Browse files Browse the repository at this point in the history
Since Arrow 0.14.5, Arrow.replace() has dropped shift functionality
in favor of Arrow.shift(). This causes an AttributeError exception
every time watson is run.

The error message is: 'AttributeError: unknown attribute: "days"'
  • Loading branch information
davidag committed Aug 11, 2019
1 parent 699ccda commit a37046c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion watson/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def get_start_time_for_period(period):
if period == 'day':
start_time = arrow.Arrow(year, month, day)
elif period == 'week':
start_time = arrow.Arrow.fromdate(now.replace(days=-weekday).date())
start_time = arrow.Arrow.fromdate(now.shift(days=-weekday).date())
elif period == 'month':
start_time = arrow.Arrow(year, month, 1)
elif period == 'luna':
Expand Down

0 comments on commit a37046c

Please sign in to comment.