Skip to content

Commit

Permalink
Add back time if interval hour
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie committed Nov 7, 2023
1 parent 01af460 commit 67f50dc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions posthog/hogql_queries/insights/trends/trends_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,18 @@ def build_series_response(self, response: HogQLQueryResponse, series: SeriesWith
for val in response.results:
series_object = {
"data": val[1],
"labels": [item.strftime("%-d-%b-%Y") for item in val[0]], # TODO: Add back in hour formatting
"days": [item.strftime("%Y-%m-%d") for item in val[0]], # TODO: Add back in hour formatting
"labels": [
item.strftime(
"%-d-%b-%Y{}".format(" %H:%M" if self.query_date_range.interval_name == "hour" else "")
)
for item in val[0]
],
"days": [
item.strftime(
"%Y-%m-%d{}".format(" %H:%M:%S" if self.query_date_range.interval_name == "hour" else "")
)
for item in val[0]
],
"count": float(sum(val[1])),
"label": "All events" if self.series_event(series.series) is None else self.series_event(series.series),
"filter": self._query_to_filter(),
Expand Down

0 comments on commit 67f50dc

Please sign in to comment.