aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/statsController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controllers/statsController.php')
-rw-r--r--app/Controllers/statsController.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index 4491443c0..7c1791dd6 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -246,4 +246,18 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController {
$this->view->hours24Labels = $hours24Labels;
}
+
+ public function unreadDatesAction(): void {
+ $statsDAO = FreshRSS_Factory::createStatsDAO();
+ $field = Minz_Request::paramString('field', plaintext: true);
+ if (!in_array($field, ['id', 'date'], true)) {
+ $field = 'id';
+ }
+ $granularity = Minz_Request::paramString('granularity', plaintext: true);
+ if (!in_array($granularity, ['day', 'month', 'year'], true)) {
+ $granularity = 'day';
+ }
+ $dates = $statsDAO->getMaxUnreadDates($field, $granularity, Minz_Request::paramInt('max') ?: 100);
+ $this->view->unreadDates = $dates;
+ }
}