FIX: counters were showing future instead of past (#6299)

This commit is contained in:
Joffrey JAFFEUX
2018-08-22 12:37:05 +02:00
committed by GitHub
parent 599cebf8ad
commit 87d443f070
5 changed files with 139 additions and 1 deletions

View File

@@ -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 } };

View File

@@ -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));

View File

@@ -79,6 +79,7 @@
{{#each activityMetrics as |metric|}}
{{admin-report
showHeader=false
filters=activityMetricsFilters
forcedModes="counters"
dataSourceName=metric}}
{{/each}}