Skip to content

Commit

Permalink
aggregations: add yearly interval
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Jan 16, 2025
1 parent f8bcd21 commit fa1266c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions invenio_stats/aggregations.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
"hour": ("minute", "second", "microsecond"),
"day": ("hour", "minute", "second", "microsecond"),
"month": ("day", "hour", "minute", "second", "microsecond"),
"year": ("month", "day", "hour", "minute", "second", "microsecond"),
}

INTERVAL_DELTAS = {
"hour": relativedelta(hours=1),
"day": relativedelta(days=1),
"month": relativedelta(months=1),
"year": relativedelta(years=1),
}


Expand Down
1 change: 1 addition & 0 deletions invenio_stats/bookmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
("hour", "%Y-%m-%dT%H"),
("day", "%Y-%m-%d"),
("month", "%Y-%m"),
("year", "%Y"),
]
)

Expand Down

0 comments on commit fa1266c

Please sign in to comment.