mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
28 lines
551 B
JavaScript
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")
|
|
);
|
|
}
|
|
}
|
|
});
|