ZJX-ARTCC / jacksonville-issue-tracker

For everyone who wants to submit enhancement requests and bug reports.
1 stars 0 forks source link

Statistics Page: Does not correctly display by quarter #22

Closed brinbrody closed 3 years ago

brinbrody commented 3 years ago

Describe the bug The current statistics page displays a blank month, followed by the first two months of a quarter, rather than displaying all three months.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://www.zjxartcc.org/statistics/'
  2. See error

Expected behavior The three months of the current quarter should be displayed sequentially.

Screenshots image

mtkft commented 3 years ago

Offending line is probably /apps/api/views.py:28

months = [calendar.month_name[now.month - 2], calendar.month_name[now.month - 1], calendar.month_name[now.month]]

If months have integer indices (ideally 0 to 11) you could structure this as months now.month %3, now.month %3 +1, now.month %3 +2 but I don't know if such indices exist.

edit: those are the indices for the months in the quarter, don't replace the line wholesale. For some sort of listofmonths you could use those as indices to point to