discourse/app/assets/javascripts/admin/routes/admin-reports-show.js.es6
2018-08-17 16:19:25 +02:00

28 lines
551 B
JavaScript

export default Discourse.Route.extend({
setupController(controller) {
this._super(...arguments);
if (!controller.get("start_date")) {
controller.set(
"start_date",
moment
.utc()
.subtract(1, "day")
.subtract(1, "month")
.startOf("day")
.format("YYYY-MM-DD")
);
}
if (!controller.get("end_date")) {
controller.set(
"end_date",
moment()
.utc()
.endOf("day")
.format("YYYY-MM-DD")
);
}
}
});