mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 05:36:29 +08:00
a914d3230b
Followup to 7d8974d02f
Co-authored-by: David Taylor <david@taylorhq.com>
41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
import Component from "@glimmer/component";
|
|
import { action } from "@ember/object";
|
|
import { service } from "@ember/service";
|
|
import DButton from "discourse/components/d-button";
|
|
import PeriodChooser from "select-kit/components/period-chooser";
|
|
import CustomDateRangeModal from "../components/modal/custom-date-range";
|
|
|
|
export default class DashboardPeriodSelector extends Component {
|
|
@service modal;
|
|
|
|
availablePeriods = ["yearly", "quarterly", "monthly", "weekly"];
|
|
|
|
@action
|
|
openCustomDateRangeModal() {
|
|
this.modal.show(CustomDateRangeModal, {
|
|
model: {
|
|
startDate: this.args.startDate,
|
|
endDate: this.args.endDate,
|
|
setCustomDateRange: this.args.setCustomDateRange,
|
|
},
|
|
});
|
|
}
|
|
|
|
<template>
|
|
<div>
|
|
<PeriodChooser
|
|
@period={{@period}}
|
|
@action={{@setPeriod}}
|
|
@content={{this.availablePeriods}}
|
|
@fullDay={{false}}
|
|
/>
|
|
<DButton
|
|
@icon="gear"
|
|
@action={{this.openCustomDateRangeModal}}
|
|
@title="admin.dashboard.custom_date_range"
|
|
class="custom-date-range-button"
|
|
/>
|
|
</div>
|
|
</template>
|
|
}
|