mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: counters were showing future instead of past (#6299)
This commit is contained in:
@@ -40,6 +40,14 @@ export default Ember.Controller.extend(PeriodComputationMixin, {
|
||||
];
|
||||
},
|
||||
|
||||
@computed
|
||||
activityMetricsFilters() {
|
||||
return {
|
||||
startDate: this.get("lastMonth"),
|
||||
endDate: this.get("today")
|
||||
};
|
||||
},
|
||||
|
||||
@computed
|
||||
trendingSearchOptions() {
|
||||
return { table: { total: false, limit: 8 } };
|
||||
|
||||
@@ -42,6 +42,15 @@ export default Ember.Mixin.create({
|
||||
.subtract(1, "week");
|
||||
},
|
||||
|
||||
@computed()
|
||||
lastMonth() {
|
||||
return moment()
|
||||
.locale("en")
|
||||
.utc()
|
||||
.startOf("day")
|
||||
.subtract(1, "month");
|
||||
},
|
||||
|
||||
@computed()
|
||||
endDate() {
|
||||
return moment()
|
||||
@@ -51,6 +60,14 @@ export default Ember.Mixin.create({
|
||||
.endOf("day");
|
||||
},
|
||||
|
||||
@computed()
|
||||
today() {
|
||||
return moment()
|
||||
.locale("en")
|
||||
.utc()
|
||||
.endOf("day");
|
||||
},
|
||||
|
||||
actions: {
|
||||
changePeriod(period) {
|
||||
DiscourseURL.routeTo(this._reportsForPeriodURL(period));
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
{{#each activityMetrics as |metric|}}
|
||||
{{admin-report
|
||||
showHeader=false
|
||||
filters=activityMetricsFilters
|
||||
forcedModes="counters"
|
||||
dataSourceName=metric}}
|
||||
{{/each}}
|
||||
|
||||
Reference in New Issue
Block a user