Skip to content

Commit

Permalink
Updated to ensure correct year is used to determine fiscal quarter
Browse files Browse the repository at this point in the history
  • Loading branch information
JackAtOmenApps committed Feb 27, 2021
1 parent 5339b83 commit 3b888cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_calendardate/date_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def get_fiscal_quarter(date):
quarter_starts = [3, 6, 9, 12]
quarter_idx = quarter_starts.index(fy_start_month)

quarter_start_dates = [datetime.date(2020, month, 1) for month in quarter_starts]
quarter_start_dates = [datetime.date(date.year, month, 1) for month in quarter_starts]

quarter = bisect.bisect(quarter_start_dates, date) - quarter_idx
return quarter if quarter > 0 else quarter + 4
Expand Down

0 comments on commit 3b888cd

Please sign in to comment.