flarum / flarum/framework

Statistics: Sum of new during period is 0 for custom date range

Open
#4,986 0 comments 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
PHP
Stars
6.7k
Forks
883
Avg merge
15h 16m
Merged PRs (30d)
73

Description

### Current Behavior

When selecting a custom date range for the Statistics graph the "New during range" cells always show 0 :(

### Steps to Reproduce

1. Open "Statistics" in admin
2. Select a custom date range
3. Observe the value fields in the mini stats table on top left

### Expected Behavior

Selecting a custom date range should calculate the sum of new items per each data type (user, discussions, posts) that occured during that custom range. This would be consistent with how this Statistics works with the pre-defined date ranges.

### Screenshots

Image

### Environment

- Flarum version: 1.8.19 (I don't have a 2.0.0-rc.7 community with sufficient historic data. Worth checking on Discuss' Statistics

### Output of `php flarum info`

_No response_

### Possible Solution

_No response_

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start from the Statistics area in the admin interface and trace how the custom date range feeds the mini stats table's "New during range" values. Reproduce the issue with a custom range containing known users, discussions, and posts, then verify each data type reports the items created within that range rather than zero.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
analytics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.