0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 17:30:29 +01:00
discourse-custom-wizard/assets/javascripts/discourse/controllers/next-session-scheduled.js.es6

28 Zeilen
691 B
Text

import { default as discourseComputed } from "discourse-common/utils/decorators";
2020-04-05 03:37:09 +02:00
import Controller from "@ember/controller";
2017-11-01 05:21:14 +01:00
2020-04-05 03:37:09 +02:00
export default Controller.extend({
title: "admin.wizard.after_time_modal.title",
2017-11-01 05:21:14 +01:00
setup() {
this.set("bufferedDateTime", moment(this.model.dateTime));
2017-11-01 05:21:14 +01:00
},
@discourseComputed("bufferedDateTime")
2017-11-01 05:21:14 +01:00
submitDisabled(dateTime) {
return moment().isAfter(dateTime);
},
actions: {
submit() {
const dateTime = this.get("bufferedDateTime");
this.get("model.update")(moment(dateTime).utc().toISOString());
2017-11-01 05:21:14 +01:00
this.send("closeModal");
},
dateTimeChanged(dateTime) {
this.set("bufferedDateTime", dateTime);
},
},
2017-11-01 05:21:14 +01:00
});