Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
cf50a7deb3
* Apply prettier * applied prettier for similar-topics-validator Co-authored-by: Faizaan Gagan <fzngagan@gmail.com>
27 Zeilen
691 B
JavaScript
27 Zeilen
691 B
JavaScript
import { default as discourseComputed } from "discourse-common/utils/decorators";
|
|
import Controller from "@ember/controller";
|
|
|
|
export default Controller.extend({
|
|
title: "admin.wizard.after_time_modal.title",
|
|
|
|
setup() {
|
|
this.set("bufferedDateTime", moment(this.model.dateTime));
|
|
},
|
|
|
|
@discourseComputed("bufferedDateTime")
|
|
submitDisabled(dateTime) {
|
|
return moment().isAfter(dateTime);
|
|
},
|
|
|
|
actions: {
|
|
submit() {
|
|
const dateTime = this.get("bufferedDateTime");
|
|
this.get("model.update")(moment(dateTime).utc().toISOString());
|
|
this.send("closeModal");
|
|
},
|
|
|
|
dateTimeChanged(dateTime) {
|
|
this.set("bufferedDateTime", dateTime);
|
|
},
|
|
},
|
|
});
|