mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 12:53:41 +08:00
21 lines
526 B
JavaScript
21 lines
526 B
JavaScript
|
import Component from "@glimmer/component";
|
||
|
import { action } from "@ember/object";
|
||
|
import { tracked } from "@glimmer/tracking";
|
||
|
|
||
|
export default class CustomDateRange extends Component {
|
||
|
@tracked startDate = this.args.model.startDate;
|
||
|
@tracked endDate = this.args.model.endDate;
|
||
|
|
||
|
@action
|
||
|
onChangeDateRange(range) {
|
||
|
this.startDate = range.from;
|
||
|
this.endDate = range.to;
|
||
|
}
|
||
|
|
||
|
@action
|
||
|
updateDateRange() {
|
||
|
this.args.model.setCustomDateRange(this.startDate, this.endDate);
|
||
|
this.args.closeModal();
|
||
|
}
|
||
|
}
|