mirror of
https://github.com/flarum/core.git
synced 2025-09-02 20:52:45 +02:00
feat(statistics): support for custom date ranges (#3622)
* feat: backend support for statistics custom date ranges * feat: use seconds-based timestamps on backend instead * feat: add frontend date selection option * feat: add tests for lifetime and timed stats * fix: add error alert when end date is after start date * fix: wrong label * fix: no data when start and end date are same day * fix: use utc dayjs for formatting custom date range on widget * chore: add dayjs as project dep * fix: make end date inclusive * feat: add integration test for custom date period * fix: incorrect ts expect error comment * fix: add missing type * fix: typing errors * fix(tests): remove type from class attribute definition * fix: extract default values to function body * fix: typo * chore: use small modal * fix: add missing `FormControl` class * fix: cast url params to int to enforce type * chore: `yarn format` Signed-off-by: Sami Mazouz <sychocouldy@gmail.com> Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
flarum-statistics:
|
||||
|
||||
##
|
||||
# UNIQUE KEYS - The following keys are used in only one location each.
|
||||
##
|
||||
|
||||
# Translations in this namespace are used by the admin interface.
|
||||
admin:
|
||||
# These translations are used in the date selection modal.
|
||||
date_selection_modal:
|
||||
description: |
|
||||
Pick a custom date range to display statistics for. Loading data may take
|
||||
multiple minutes on forums with a lot of activity.
|
||||
end_date: End date (inclusive)
|
||||
errors:
|
||||
end_before_start: The end date must be after the start date.
|
||||
start_date: Start date (inclusive)
|
||||
submit_button: Confirm date range
|
||||
title: Choose custom date range
|
||||
|
||||
# These translations are used in the Statistics dashboard widget.
|
||||
statistics:
|
||||
@@ -16,9 +26,12 @@ flarum-statistics:
|
||||
mini_heading: Forum statistics
|
||||
previous_28_days_label: Previous 28 days
|
||||
previous_7_days_label: Previous 7 days
|
||||
custom_label: Choose custom range...
|
||||
custom_label_specified: "{fromDate} to {toDate}"
|
||||
loading: => core.ref.loading
|
||||
posts_heading: => core.ref.posts
|
||||
today_label: Today
|
||||
total_label: Total
|
||||
users_heading: => core.ref.users
|
||||
view_full: View more statistics
|
||||
no_data: There is no data available for this date range.
|
||||
|
Reference in New Issue
Block a user